# Yahoo! UI Library

### animation 2.7.0

Yahoo! UI Library > animation > YAHOO.util.Scroll
Search:
Filters Show Private Show Protected Show Deprecated

## Class YAHOO.util.Scroll - extends YAHOO.util.ColorAnim

Anim subclass for scrolling elements to a position defined by the "scroll" member of "attributes". All "scroll" members are arrays with x, y scroll positions.

Usage: `var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);`

### Constructor

YAHOO.util.Scroll `( el , attributes , duration , method )`

Parameters:
  `el <String or HTMLElement>` Reference to the element that will be animated
  `attributes <Object>` The attribute(s) to be animated. Each attribute is an object with at minimum a "to" or "by" member defined. Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). All attribute names use camelCase.
  `duration <Number>` (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based
  `method <Function>` (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)

#### Properties inherited from YAHOO.util.Anim:

`_onComplete, _onStart, _onTween, actualFrames, attributes, currentFrame, duration, el, isAnimated, method, startTime, totalFrames, useSeconds`

#### Methods inherited from YAHOO.util.Anim:

`animate, doMethod, getAttribute, getDefaultUnit, getEl, getStartTime, init, isAnimated, onTween, setAttribute, setEl, setRuntimeAttribute, stop, toString`

#### Methods inherited from YAHOO.util.ColorAnim:

`parseColor`

#### Events inherited from YAHOO.util.Anim:

`onComplete, onStart, onTween,`

Copyright © 2009 Yahoo! Inc. All rights reserved.