jQuery .finish() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Effects

Definition

.finish() (since jQuery 1.9) stops the currently-running animation, removes all queued animations, and sets CSS to the end values of every step — current and queued. Returns the jQuery object for chaining.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
$el.finish();           // default queue: "fx"
$el.finish("fx");       // same, explicit
$el.finish("tasks");    // named queue only

// Like .stop(true, true) — PLUS end CSS for queued steps
// Queue is empty afterward
CallWhat it does
.finish()Learn jQuery .finish(): stop the current animation, clear the fx queue, and jump every queued step to its end CSS since 1.9. Compare with .stop(true, true), .clearQueue(), and jQuery.fx.off.

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Queue one or more effects (.animate(), .fadeToggle(), …).
Step 2Call $el.finish() (optional queue name; default "fx").
Step 3The active tween stops and jumps to its end CSS.

Return Value

Return ValueDescription
jQuery objectMost setters and traversing helpers return the jQuery collection so you can chain more methods.
Value / undefinedGetters usually return a value from the first matched element, or undefined when nothing applies.

jQuery Examples

Example 1 — Go Then .finish()

Official pattern: chain three .animate() steps, then jump to the combined end state.

jQuery
$("#go").on("click", function () {
  $("#box")
    .clearQueue()
    .stop()
    .css({ marginLeft: 0, opacity: 1, fontSize: 16 })
    .animate({ marginLeft: 120 }, 2000)
    .animate({ opacity: 0.3 }, 2000)
    .animate({ fontSize: 28 }, 2000);
});

$("#finish").on("click", function () {
  $("#box").finish();
});
Try It Yourself

How It Works

  1. Reset. clearQueue().stop() clears any prior run.
  2. Chain. Three .animate() calls enqueue on fx.
  3. Finish. Active + queued steps jump to their end CSS.

Example 2 — .finish() vs .stop(true, true)

Same chain on two boxes — see which end CSS each method keeps.

jQuery
function start($el) {
  $el.clearQueue().stop()
    .css({ marginLeft: 0, fontSize: 16 })
    .animate({ marginLeft: 160 }, 2000)
    .animate({ fontSize: 28 }, 2000);
}

$("#go-both").on("click", function () {
  start($("#boxA"));
  start($("#boxB"));
});

$("#btn-finish").on("click", function () {
  $("#boxA").finish();
});

$("#btn-stop").on("click", function () {
  $("#boxB").stop(true, true);
});
Try It Yourself

How It Works

  1. Same start. Both boxes run the identical two-step chain.
  2. finish. Applies end CSS for step 1 and step 2.
  3. stop(true,true). Jumps only the current step; drops the rest.

Example 3 — Multi-Property Chain

Animate margin, then opacity, then font size — finish collapses all three.

jQuery
$("#start").on("click", function () {
  $("#chain")
    .clearQueue().stop()
    .css({ marginLeft: 0, opacity: 1, fontSize: 16 })
    .animate({ marginLeft: 100 }, 1500)
    .animate({ opacity: 0.4 }, 1500)
    .animate({ fontSize: 24 }, 1500);
});

$("#finish-chain").on("click", function () {
  $("#chain").finish();
});
Try It Yourself

How It Works

  1. Queue. fx runs one animate at a time.
  2. Wait. Without finish, the full chain takes ~4.5 s.
  3. Collapse. .finish() applies every step’s end CSS now.

Frequently Asked Questions

.finish() stops the currently-running animation, removes all queued animations, and jumps CSS properties to the end values of the current step and every queued step. It returns a jQuery object for chaining.
Both clear the queue and jump the current animation to its end value. .finish() also applies the end CSS of every queued animation before removing those steps. .stop(true, true) discards queued steps without applying their target CSS.
.finish([queue]) accepts an optional string. The default is "fx" — jQuery’s effects queue used by .animate(), .fadeToggle(), and similar methods. Pass a custom name to finish only that named queue.
.finish() was added in jQuery 1.9. Use it on the same fx pipeline as .stop(), .clearQueue(), and .queue().
Yes. Entries still on the fx queue — including custom .queue(fn) callbacks — are processed so each step reaches completion. Use .clearQueue().finish() if you want to drop pending queue items first, then finish only the active animation.
Setting jQuery.fx.off = true disables all effects globally. Animation methods then jump elements to their final state when called, instead of displaying a tween. See jQuery.fx.off for details.

Next: jQuery.fx.interval Property

Control how often jQuery ticks the fx animation timer.

jQuery.fx.interval Property tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful