<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Quick Tip: Prevent Animation Queue Buildup</title>
	<atom:link href="http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Tue, 21 May 2013 00:41:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Hello world! &#124; front and development</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-87446</link>
		<dc:creator>Hello world! &#124; front and development</dc:creator>
		<pubDate>Fri, 15 Feb 2013 15:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-87446</guid>
		<description><![CDATA[[...] It&#8217;s also something that you see done poorly on even the most famous of web sites. This article provides a straight forward example of built up animations and demonstrates how visually jarring [...]]]></description>
		<content:encoded><![CDATA[<p>[...] It&#8217;s also something that you see done poorly on even the most famous of web sites. This article provides a straight forward example of built up animations and demonstrates how visually jarring [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Desarrollo Front End : directrices &#124; Base de Datos de Conocimiento</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-87421</link>
		<dc:creator>Desarrollo Front End : directrices &#124; Base de Datos de Conocimiento</dc:creator>
		<pubDate>Wed, 30 Jan 2013 10:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-87421</guid>
		<description><![CDATA[[...] It&#8217;s also something that you see done poorly on even the most famous of web sites. This article provides a straight forward example of built up animations and demonstrates how visually jarring [...]]]></description>
		<content:encoded><![CDATA[<p>[...] It&#8217;s also something that you see done poorly on even the most famous of web sites. This article provides a straight forward example of built up animations and demonstrates how visually jarring [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hego555</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-87362</link>
		<dc:creator>hego555</dc:creator>
		<pubDate>Fri, 30 Nov 2012 08:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-87362</guid>
		<description><![CDATA[Wow, how simple is that :) Many thanks for this. Was quite annoying watching my effects dance!]]></description>
		<content:encoded><![CDATA[<p>Wow, how simple is that :) Many thanks for this. Was quite annoying watching my effects dance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-87338</link>
		<dc:creator>John</dc:creator>
		<pubDate>Sat, 10 Nov 2012 13:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-87338</guid>
		<description><![CDATA[Helpful article but there&#039;s a HUGE problem with it.

Just calling .stop() without arguments will FREEZE the animation.
For your usage case, that&#039;s perfect, because you&#039;re animating rollover &quot;sliding&quot; buttons that, when rolled over, begin to animate to move towards the right, and when you remove the mouse it should of course FREEZE at the exact location it was and THEN begin animating towards the neutral position again.

So, yes your article is PERFECT for ROLLOVERS and other similar cases.

HOWEVER, let&#039;s say you use an onclick event to trigger toggling between a .slideUp()/.slideDown() combo on and element and the user spam-clicks it. Click things enough and the element will end up frozen in some inbetween state between the two animation locations.

The solution is to read the jQuery documentation: http://api.jquery.com/stop/

It says that if your GOAL is to ABORT the current animation and animate into some other state, the CORRECT thing to do is to call .stop(true, true) - what this does is that IMMEDIATELY finalizes the ongoing animation by setting all the CSS to their final properties that it had been animating towards (such as a .slideUp()) so that the element is in a known-good-state (fully rolled up)), before you try to apply your slidedown animation.

So, I repeat, the code above in your example SHOULD be .stop(true, true) for A LOT of cases.

Please update the article with this caveat because it&#039;s a very high-ranked Google result and a lot of people get their information from here.

Basically, people need to compare .stop() and .stop(true, true) to see what they need for their specific case.]]></description>
		<content:encoded><![CDATA[<p>Helpful article but there&#8217;s a HUGE problem with it.</p>
<p>Just calling .stop() without arguments will FREEZE the animation.<br />
For your usage case, that&#8217;s perfect, because you&#8217;re animating rollover &#8220;sliding&#8221; buttons that, when rolled over, begin to animate to move towards the right, and when you remove the mouse it should of course FREEZE at the exact location it was and THEN begin animating towards the neutral position again.</p>
<p>So, yes your article is PERFECT for ROLLOVERS and other similar cases.</p>
<p>HOWEVER, let&#8217;s say you use an onclick event to trigger toggling between a .slideUp()/.slideDown() combo on and element and the user spam-clicks it. Click things enough and the element will end up frozen in some inbetween state between the two animation locations.</p>
<p>The solution is to read the jQuery documentation: <a href="http://api.jquery.com/stop/" rel="nofollow">http://api.jquery.com/stop/</a></p>
<p>It says that if your GOAL is to ABORT the current animation and animate into some other state, the CORRECT thing to do is to call .stop(true, true) &#8211; what this does is that IMMEDIATELY finalizes the ongoing animation by setting all the CSS to their final properties that it had been animating towards (such as a .slideUp()) so that the element is in a known-good-state (fully rolled up)), before you try to apply your slidedown animation.</p>
<p>So, I repeat, the code above in your example SHOULD be .stop(true, true) for A LOT of cases.</p>
<p>Please update the article with this caveat because it&#8217;s a very high-ranked Google result and a lot of people get their information from here.</p>
<p>Basically, people need to compare .stop() and .stop(true, true) to see what they need for their specific case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: netd1ver</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-1#comment-87304</link>
		<dc:creator>netd1ver</dc:creator>
		<pubDate>Tue, 09 Oct 2012 03:31:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-87304</guid>
		<description><![CDATA[I have tried two stop()s and also many other solutions on replies,
but Ira&#039;s this way of use only one stop() before slideDown() (or animate) does look best with the delayed callback. Thank you, Brandon &amp; Ira!

&lt;pre&gt;&lt;code&gt;
$(&quot;#nav&quot;).find(&quot;li&quot;).each(function() {
	var jq = $(this);
	var dl = jq.find(&quot;dl&quot;);
	if (dl.length &gt; 0) {
		jq.hover(function() {
			dl.stop(true,true).slideDown(&quot;slow&quot;);
		}, function() {
			dl.delay(250).fadeOut(&quot;slow&quot;);
		});
	}
});
&lt;/code&gt;&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>I have tried two stop()s and also many other solutions on replies,<br />
but Ira&#8217;s this way of use only one stop() before slideDown() (or animate) does look best with the delayed callback. Thank you, Brandon &amp; Ira!</p>
<pre><code>
$("#nav").find("li").each(function() {
	var jq = $(this);
	var dl = jq.find("dl");
	if (dl.length &gt; 0) {
		jq.hover(function() {
			dl.stop(true,true).slideDown("slow");
		}, function() {
			dl.delay(250).fadeOut("slow");
		});
	}
});
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-1#comment-86624</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Thu, 22 Mar 2012 01:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-86624</guid>
		<description><![CDATA[This works great ! Thanks for great tips !]]></description>
		<content:encoded><![CDATA[<p>This works great ! Thanks for great tips !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-86611</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Fri, 09 Mar 2012 21:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-86611</guid>
		<description><![CDATA[Just a quick thanks for posting this tutorial. I was using jquery animation with a hover event just like your example. Using the .stop call was all that was needed to make it work beautifully.]]></description>
		<content:encoded><![CDATA[<p>Just a quick thanks for posting this tutorial. I was using jquery animation with a hover event just like your example. Using the .stop call was all that was needed to make it work beautifully.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jQuery animate() slide up content expander &#8211; Kinetic Designs</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-2#comment-86604</link>
		<dc:creator>jQuery animate() slide up content expander &#8211; Kinetic Designs</dc:creator>
		<pubDate>Sat, 03 Mar 2012 19:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-86604</guid>
		<description><![CDATA[[...] two was a snippet of jquery i had not yet learned about. This is the stop() function. Here is a great tutorial on how to implement this [...]]]></description>
		<content:encoded><![CDATA[<p>[...] two was a snippet of jquery i had not yet learned about. This is the stop() function. Here is a great tutorial on how to implement this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Brutsche &#8211; Stop jQuery animations from backing up &#124; Jeff Brutsche</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-1#comment-86573</link>
		<dc:creator>Jeff Brutsche &#8211; Stop jQuery animations from backing up &#124; Jeff Brutsche</dc:creator>
		<pubDate>Wed, 15 Feb 2012 02:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-86573</guid>
		<description><![CDATA[[...] Now on to the important part, if you ever run into the issue of jQuery animations that have to complete their mouseover and mouseout events before being able to repeat them. I am currently to lazy to code an example of this. But i will link to an example, and actually the article that helped me solve this issue the first time that I ran into this issue. So here is credit where credit is due Click Here for the Original Article. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Now on to the important part, if you ever run into the issue of jQuery animations that have to complete their mouseover and mouseout events before being able to repeat them. I am currently to lazy to code an example of this. But i will link to an example, and actually the article that helped me solve this issue the first time that I ran into this issue. So here is credit where credit is due Click Here for the Original Article. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/comment-page-1#comment-86546</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Thu, 09 Feb 2012 20:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=267#comment-86546</guid>
		<description><![CDATA[Several years after this post was created it&#039;s still helping people. This solved an issue I was having with a rotating banner I created. Had no idea there was even a such thing as animation buildup within jQuery.

Thanks for writing this article 4 years ago!]]></description>
		<content:encoded><![CDATA[<p>Several years after this post was created it&#8217;s still helping people. This solved an issue I was having with a rotating banner I created. Had no idea there was even a such thing as animation buildup within jQuery.</p>
<p>Thanks for writing this article 4 years ago!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 5/23 queries in 0.008 seconds using disk
Object Caching 363/373 objects using disk
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

 Served from: www.learningjquery.com @ 2013-05-25 06:54:37 by W3 Total Cache -->