O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

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

Stopping Animation

$("*").stop(); $("#img1").stop(true); $("img").stop(true, true);

jQuery allows you to stop the animations currently executing on elements contained in the jQuery object set. The .stop([clearQueue] [, jumpToEnd]) method allows you stop animations in a few different ways.

Calling .stop() with no parameters simply pauses the animations that are in the queue. The next animation that starts begin executing the animations in the queue again. For example, the following code pauses all animations:

$("*").stop();

Calling .stop(true), with the cleareQueue option set to true stops animations at the current point and removes all animations from the queue. For example, the following stops all animations on images and removes the ...

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