YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

animation  2.5.0

Yahoo! UI Library > animation > YAHOO.util.Motion

Show Private Show Protected

Class YAHOO.util.Motion - extends YAHOO.util.ColorAnim

Anim subclass for moving elements along a path defined by the "points" member of "attributes". All "points" are arrays with x, y coordinates.

Usage: var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);

Constructor

YAHOO.util.Motion ( el , attributes , duration , method )
Parameters:
el <String | 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)

Methods inherited from YAHOO.util.ColorAnim:

Events inherited from YAHOO.util.Anim:


Copyright © 2007 Yahoo! Inc. All rights reserved.