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 ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.