English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The stop() method stops the animation that is currently running.
The stop() method is applicable to all jQuery effect functions, including sliding, fading in and out, and custom animations.
When stop() is called on an element, the currently running animation (if any) will stop immediately.
If multiple animation methods are called on the same element, the subsequent animations will be placed in the effect queue of that element.
$(selector).stop(clearQueue, jumpToEnd)
Stop the currently running animation:
$("button").click(function(){ $("div").stop(); });Test and see‹/›
Also stop the queued animations:
$("button").click(function(){ $("div").stop(true); });Test and see‹/›
Complete all animations immediately:
$("button").click(function(){ $("div").stop(true, true); });Test and see‹/›
Parameter | Description |
---|---|
clearQueue | An optional boolean value indicating whether to also clear the queue of animations. The default is false |
jumpToEnd | An optional boolean value indicating whether to complete the current animation immediately. The default is false |