English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The jQuery stop() method is used to stop a jQuery animation or effect before it is completed.
jQuery is a fast, lightweight, and feature-rich JavaScript library based on the principle of 'less code, more work'.
jQuery simplifies the traversal of HTML documents, event handling, animations, and Ajax interactions, thus enabling rapid web development.
jQuery is a fast, lightweight, and feature-rich JavaScript library based on the principle of 'less code, more work'.
jQuery simplifies the traversal of HTML documents, event handling, animations, and Ajax interactions, thus enabling rapid web development.
stop()The method stops the jQuery animation or effect running on the selected element before completion.
When the stop() method is called on an element, any currently running animation (if any) is immediately stopped.
If multiple animation methods are called on the same element, the subsequent animations will be placed in the effect queue.
Thisstop()The syntax of the method is:
$ (selector).stop(clearQueue, jumpToEnd)
The stop() method accepts two optional parameters:
clearQueue-A boolean value indicating whether to also remove the queued animations. The default is false
jumpToEnd-A boolean value indicating whether to immediately complete the current animation. The default is false
The following example stops the currently running animation:
$("button").click(function(){ $("div").stop(); });Test See More‹/›
The following example stops all queued animations at the same time:
$("button").click(function(){ $("div").stop(true); });Test See More‹/›
The following example stops all animations immediately after they are completed:
$("button").click(function(){ $("div").stop(true, true); });Test See More‹/›
For a complete effect reference, please visit ourjQuery Effect Reference Manual.