<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Playing With User Interface Feature &#187; Yahoo! UI Library</title>
	<atom:link href="http://williamduff.name/tag/yahoo-ui-library/feed/" rel="self" type="application/rss+xml" />
	<link>http://williamduff.name</link>
	<description></description>
	<lastBuildDate>Thu, 10 May 2012 15:21:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Yahoo! UI Library: YAHOO.util.Anim</title>
		<link>http://williamduff.name/yahoo-ui-library-yahoo-util-anim/</link>
		<comments>http://williamduff.name/yahoo-ui-library-yahoo-util-anim/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 13:37:32 +0000</pubDate>
		<dc:creator>william</dc:creator>
				<category><![CDATA[Yahoo]]></category>
		<category><![CDATA[Yahoo! UI Library]]></category>

		<guid isPermaLink="false">http://williamduff.name/?p=16</guid>
		<description><![CDATA[Class YAHOO.util.Anim Known Subclasses: YAHOO.util.ColorAnim Base animation class that provides the interface for building animated effects.Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);  [...]]]></description>
			<content:encoded><![CDATA[<h2>Class <strong>YAHOO.util.Anim</strong></h2>
<p><!-- class tree goes here --></p>
<dl>
<dt>Known Subclasses:</dt>
<dd> YAHOO.util.ColorAnim </dd>
</dl>
<div>
<p>Base animation class that provides the interface for building animated effects.Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);</p>
</div>
<div>
<h3 id="constructor">Constructor</h3>
<div>
<div>
<p><strong>YAHOO.util.Anim</strong> <code> (                                                                                                                                              el                                                  ,                                                  attributes                                                  ,                                                  duration                                                  ,                                                  method                                     ) </code></p>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>el                                                     &lt;String | HTMLElement&gt; </code> Reference to the element that will be animated </dd>
<dd> <code>attributes                                                     &lt;Object&gt; </code> The attribute(s) to be animated.   Each attribute is an object with at minimum a &#8220;to&#8221; or &#8220;by&#8221; member defined.   Additional optional members are &#8220;from&#8221; (defaults to current value), &#8220;units&#8221; (defaults to &#8220;px&#8221;).   All attribute names use camelCase. </dd>
<dd> <code>duration                                                     &lt;Number&gt; </code> (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based </dd>
<dd> <code>method                                                     &lt;Function&gt; </code> (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) </dd>
</dl>
</div>
</div>
</div>
</div>
<div>
<div>
<h3 id="properties">Properties</h3>
<div>
<div>
<h4><a name="property__onComplete">_onComplete</a> &#8211; <code>private object</code></h4>
<div>
<div>Custom event that fires after onComplete</div>
</div>
<hr />
</div>
<div>
<h4><a name="property__onStart">_onStart</a> &#8211; <code>private object</code></h4>
<div>
<div>Custom event that fires after onStart, useful in subclassing</div>
</div>
<hr />
</div>
<div>
<h4><a name="property__onTween">_onTween</a> &#8211; <code>private object</code></h4>
<div>
<div>Custom event that fires after onTween</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_actualFrames">actualFrames</a> &#8211; <code>private Int</code></h4>
<div>
<div>The number of frames this animation was able to execute.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_attributes">attributes</a> &#8211; <code>Object</code></h4>
<div>
<div>The collection of attributes to be animated. Each attribute must have at least a &#8220;to&#8221; or &#8220;by&#8221; defined in order to animate. If &#8220;to&#8221; is supplied, the animation will end with the attribute at that value. If &#8220;by&#8221; is supplied, the animation will end at that value plus its starting value. If both are supplied, &#8220;to&#8221; is used, and &#8220;by&#8221; is ignored. Optional additional member include &#8220;from&#8221; (the value the attribute should start animating from, defaults to current value), and &#8220;unit&#8221; (the units to apply to the values).</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_currentFrame">currentFrame</a> &#8211; <code>Int</code></h4>
<div>
<div>The location of the current animation on the timeline. In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_duration">duration</a> &#8211; <code>Number</code></h4>
<div>
<div>The length of the animation.  Defaults to &#8220;1&#8243; (second).</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_el">el</a> &#8211; <code>private HTMLElement</code></h4>
<div>
<div>The element to be animated.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_isAnimated">isAnimated</a> &#8211; <code>private Boolean</code></h4>
<div>
<div>Whether or not the animation is running.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_method">method</a> &#8211; <code>Function</code></h4>
<div>
<div>The method that will provide values to the attribute(s) during the animation.  Defaults to &#8220;YAHOO.util.Easing.easeNone&#8221;.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_startTime">startTime</a> &#8211; <code>private Date</code></h4>
<div>
<div>A Date object that is created when the animation begins.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_totalFrames">totalFrames</a> &#8211; <code>Int</code></h4>
<div>
<div>The total number of frames to be executed. In time-based animations, this is used by AnimMgr to ensure the animation finishes on time.</div>
</div>
<hr />
</div>
<div>
<h4><a name="property_useSeconds">useSeconds</a> &#8211; <code>Boolean</code></h4>
<div>
<div>Whether or not the duration should be treated as seconds. Defaults to true.</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div>
<div>
<h3 id="methods">Methods</h3>
<div>
<div>
<h4><a name="method_animate">animate</a></h4>
<div>
<p><code> void                                             <strong>animate</strong> (                                             ) </code></p>
<div>Starts the animation by registering it with the animation manager.</div>
<div>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_doMethod">doMethod</a></h4>
<div>
<p><code> Number                                             <strong>doMethod</strong> (                                                                                                                                                                    attr                                                                                                                                                               ,                                                           start                                                                                                                                                               ,                                                           end                                                                                                                                                   ) </code></p>
<div>Returns the value computed by the animation&#8217;s &#8220;method&#8221;.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>attr                                                         &lt;String&gt; </code> The name of the attribute. </dd>
<dd> <code>start                                                         &lt;Number&gt; </code> The value this attribute should start from for this animation. </dd>
<dd> <code>end                                                         &lt;Number&gt; </code> The value this attribute should end at for this animation. </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> Number </code></dt>
<dd>The Value to be applied to the attribute.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_getAttribute">getAttribute</a></h4>
<div>
<p><code> Number                                             <strong>getAttribute</strong> (                                                                                                                                                                    attr                                                                                                                                                   ) </code></p>
<div>Returns current value of the attribute.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>attr                                                         &lt;String&gt; </code> The name of the attribute. </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> Number </code></dt>
<dd>val The current value of the attribute.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_getDefaultUnit">getDefaultUnit</a></h4>
<div>
<p><code> String                                             <strong>getDefaultUnit</strong> (                                                                                                                                                                    attr                                                                                                                                                   ) </code></p>
<div>Returns the unit to use when none is supplied.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>attr                                                         &lt;attr&gt; </code> The name of the attribute. </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> String </code></dt>
<dd>The default unit to be used.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_getEl">getEl</a></h4>
<div>
<p><code> HTMLElement                                             <strong>getEl</strong> (                                             ) </code></p>
<div>Returns a reference to the animated element.</div>
<div>
<dl>
<dt>Returns:                                                     <code> HTMLElement </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_getStartTime">getStartTime</a></h4>
<div>
<p><code> Date                                             <strong>getStartTime</strong> (                                             ) </code></p>
<div>Returns the animation start time.</div>
<div>
<dl>
<dt>Returns:                                                     <code> Date </code></dt>
<dd>current value of startTime.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_init">init</a></h4>
<div>
<p><code> void                                             <strong>init</strong> (                                                                                                                                                                    el                                                                                                                                                               ,                                                           attributes                                                                                                                                                               ,                                                           duration                                                                                                                                                               ,                                                           method                                                                                                                                                   ) </code></p>
<div>Constructor for Anim instance.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>el                                                         &lt;String | HTMLElement&gt; </code> Reference to the element that will be animated </dd>
<dd> <code>attributes                                                         &lt;Object&gt; </code> The attribute(s) to be animated.   Each attribute is an object with at minimum a &#8220;to&#8221; or &#8220;by&#8221; member defined.   Additional optional members are &#8220;from&#8221; (defaults to current value), &#8220;units&#8221; (defaults to &#8220;px&#8221;).   All attribute names use camelCase. </dd>
<dd> <code>duration                                                         &lt;Number&gt; </code> (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based </dd>
<dd> <code>method                                                         &lt;Function&gt; </code> (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_isAnimated">isAnimated</a></h4>
<div>
<p><code> Boolean                                             <strong>isAnimated</strong> (                                             ) </code></p>
<div>Checks whether the element is currently animated.</div>
<div>
<dl>
<dt>Returns:                                                     <code> Boolean </code></dt>
<dd>current value of isAnimated.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_onTween">onTween</a></h4>
<div>
<p><code> private                                                                                                                            void                                             <strong>onTween</strong> (                                             ) </code></p>
<div>Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s).</div>
<div>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_setAttribute">setAttribute</a></h4>
<div>
<p><code> void                                             <strong>setAttribute</strong> (                                                                                                                                                                    attr                                                                                                                                                               ,                                                           val                                                                                                                                                               ,                                                           unit                                                                                                                                                   ) </code></p>
<div>Applies a value to an attribute.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>attr                                                         &lt;String&gt; </code> The name of the attribute. </dd>
<dd> <code>val                                                         &lt;Number&gt; </code> The value to be applied to the attribute. </dd>
<dd> <code>unit                                                         &lt;String&gt; </code> The unit (&#8216;px&#8217;, &#8216;%&#8217;, etc.) of the value. </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_setEl">setEl</a></h4>
<div>
<p><code> void                                             <strong>setEl</strong> (                                             ) </code></p>
<div>Changes the animated element</div>
<div>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_setRuntimeAttribute">setRuntimeAttribute</a></h4>
<div>
<p><code> private                                                                                                                            void                                             <strong>setRuntimeAttribute</strong> (                                                                                                                                                                    attr                                                                                                                                                   ) </code></p>
<div>Sets the actual values to be used during the animation. Should only be needed for subclass use.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>attr                                                         &lt;Object&gt; </code> The attribute object </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_stop">stop</a></h4>
<div>
<p><code> void                                             <strong>stop</strong> (                                                                                                                                                                    finish                                                                                                                                                   ) </code></p>
<div>Stops the animation.  Normally called by AnimMgr when animation completes.</div>
<div>
<dl>
<dt>Parameters:</dt>
<dd> <code>finish                                                         &lt;Boolean&gt; </code> (optional) If true, animation will jump to final frame. </dd>
</dl>
<dl>
<dt>Returns:                                                     <code> void </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
<div>
<h4><a name="method_toString">toString</a></h4>
<div>
<p><code> String                                             <strong>toString</strong> (                                             ) </code></p>
<div>Provides a readable name for the Anim instance.</div>
<div>
<dl>
<dt>Returns:                                                     <code> String </code></dt>
<dd> </dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<h3 id="events">Events</h3>
<div>
<h4><a name="event_onComplete">onComplete</a></h4>
<div>
<p><code> <strong>onComplete</strong> (                                             ) </code></p>
<div>Custom event that fires when animation ends Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction)</div>
</div>
<hr />
</div>
<div>
<h4><a name="event_onStart">onStart</a></h4>
<div>
<p><code> <strong>onStart</strong> (                                             ) </code></p>
<div>Custom event that fires when animation begins Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction)</div>
</div>
<hr />
</div>
<h4><a name="event_onTween">onTween</a></h4>
<p><code> <strong>onTween</strong> (                                             ) </code></p>
<div>Custom event that fires between each frame Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction)</div>
]]></content:encoded>
			<wfw:commentRss>http://williamduff.name/yahoo-ui-library-yahoo-util-anim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

