English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery effect stop() method

jQuery Effect Methods

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.

Syntax:

$(selector).stop(clearQueue, jumpToEnd)

Example

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 Value

ParameterDescription
clearQueueAn optional boolean value indicating whether to also clear the queue of animations. The default is false
jumpToEndAn optional boolean value indicating whether to complete the current animation immediately. The default is false

jQuery Effect Methods