O'Reilly logo

Mastering jQuery by Alex Libby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling the jQuery animation queue

If you have spent any time developing with jQuery, there is no doubt that you will come across a key issue when working with animations: how many times have you seen a browser cycle through multiple queued animations when you switch to another browser window and back again?

I can bet that the answer is quite a few times; the key to this issue boils down to jQuery queuing all the animations it has been asked to perform. If too many initiations take place, then jQuery's animation queue becomes confused and hence it seems to go crazy! Let's take a look at the issue in action before working through a simple fix for the problem:

  1. Start by extracting the blockedqueue.html and blockedqueue.css files from the code download ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required