.stop([clearQueue] [, jumpToEnd]) stops the currently-running animation on matched elements (since 1.2). Since 1.7 you can also target a named queue: .stop([queue] [, clearQueue] [, jumpToEnd]).
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$("#box").stop(); // freeze current tween
$("#box").stop(true); // freeze + clear remaining queue
$("#box").stop(true, true); // clear queue + jump to end CSS
$("#box").stop("fx", true, true); // same, named queue (1.7+)
// Hover-safe fade (official pattern)
$("#hover").hover(
function () { $(this).find("img").stop(true, true).fadeOut(); },
function () { $(this).find("img").stop(true, true).fadeIn(); }
);
Call
What it does
clearQueue
Remove remaining animations from the queue
jumpToEnd
Complete the current animation immediately (fires its callback)
queue
Named queue to stop (string form since 1.7)
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Start an animation with .animate(), .fadeIn(), .slideUp(), etc.
Step 2
Call .stop() on the same element when you need to interrupt it.
Step 3
Set clearQueue if later queued steps should never run.
Return Value
Return Value
Description
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery Examples
Example 1 — Stop Mid-Animation
Start a long move, then freeze it where it is.
jQuery
$("#go").on("click", function () {
$("#box").animate({ marginLeft: 160 }, 2000);
});
$("#stop").on("click", function () {
$("#box").stop();
});
$("#back").on("click", function () {
$("#box").animate({ marginLeft: 0 }, 2000);
});
.stop() immediately stops the currently-running animation on matched elements. By default the element freezes at its in-progress CSS values. If clearQueue is false (default), the next queued animation starts right away.
clearQueue (default false) removes remaining animations from the queue when true. jumpToEnd (default false) snaps the current animation to its target CSS and runs its complete callback when true. .stop(true, true) clears the queue and finishes the active step.
No — unless jumpToEnd is true. A plain .stop() freezes without calling the current step’s complete handler. With jumpToEnd true, the callback for that active step runs after the snap-to-end.
.stop(true, true) clears pending queue items and jumps only the current animation to its end CSS — queued steps never apply. .finish() (since 1.9) completes the current animation and every queued animation to their final CSS values.
On rapid hover or click handlers before starting a new fadeIn / fadeOut / slide. It clears stacked tweens and jumps to the end state so half-finished effects do not queue up and flicker.
You can pass a queue name string as the first argument: .stop(queue, clearQueue, jumpToEnd). Also, stopping a toggled animation mid-flight keeps better internal toggle state than older versions did.