.dequeue() (since jQuery 1.2) removes the next function from a queue and runs it immediately. Default queue is "fx". Returns the jQuery object for chaining.
Remember
$el.dequeue(); // advance fx
$el.dequeue("tasks"); // advance a named queue
// Classic custom step:
$el.queue(function () {
$(this).addClass("done").dequeue();
});
// Modern equivalent:
$el.queue(function (next) {
$(this).addClass("done");
next();
});
Add a custom step with .queue(), do your work, then call .dequeue() (or next()) so the chain continues.
Chain effects on an element (.animate(…)).
Insert a custom step with .queue(function () { … }).
Inside that function, do non-animation work (toggle a class, update text).
Call $(this).dequeue() or next() to run the next queued step.
For a named queue, pass the same name: .dequeue("tasks").
Piece
Required?
Role
Matched set
Yes
Elements whose queue you advance
queueName
No
Defaults to "fx"; pass a custom name when needed
Return value
—
jQuery object (chainable)
Pseudocode
Pseudocode
call $(elements).dequeue(queueName?)
name = queueName or "fx"
for each matched element:
take the next function off queue "name"
if a function was waiting:
execute it now
(that function should call dequeue/next
so later steps keep running)
return the jQuery set for chaining
Reference
Cheat Sheet
Keep these facts handy while wiring custom queue steps.
Topic
Detail
Syntax
.dequeue( [queueName] )
Since
jQuery 1.2
Default queue
"fx"
Does
Remove next function → run it
Classic continue
$(this).dequeue()
Modern continue
next() inside .queue(fn)
Named queue
$el.dequeue("tasks")
vs clearQueue
Runs next · clear drops without running
Auto for animate?
Yes · custom .queue(fn) needs manual continue
Try it
Live Preview
Run the official-style chain: move → move → toggleClass + dequeue → return.
Box
The mid-chain queue step toggles a highlight class, then dequeue lets the return animation run.
Result
Ready — click Run to dequeue mid-chain.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official Animate + toggleClass
From the jQuery docs: insert a class toggle between animates and continue with .dequeue().
.dequeue() has been part of jQuery since 1.2. It works in every browser that runs your loaded jQuery version — no separate queue feature flag.
✓ Stable · jQuery 1.2+
jQuery .dequeue()
Supported across jQuery 1.x (1.2+), 2.x, and 3.x. Prefer a current jQuery 3.x build. Use it (or next()) to finish custom .queue() steps.
100%With jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.dequeue()Universal
Bottom line: Safe for everyday queue control. Remember: animations auto-advance; custom queue callbacks need an explicit continue.
Analysis
Performance Notes
Approach
Cost
Best for
One .dequeue() in a chain
Cheap
Custom mid-animation steps
Stalled queues
Wasted waiting
Always continue custom steps
Deep custom pipelines
Harder to reason about
Keep steps few; prefer next()
Dequeuing itself is inexpensive. The costly bug is a stalled queue that leaves animations hanging — finish every custom step with .dequeue() or next().
Remember
Key Takeaways
Role: run the next queued function — since jQuery 1.2.
Continue:$(this).dequeue() or next() after custom work.
Auto:.animate() / fades advance fx for you.
vs clear: dequeue runs next · .clearQueue() drops without running.
One line:.dequeue() advances a queue by running the next waiting function — required after custom .queue() steps.
Frequently Asked Questions
.dequeue() removes the next function from the specified queue and executes it immediately. It advances the queue by one step — unlike .clearQueue(), which drops all pending items without running them.
An optional string naming which queue to advance. It defaults to "fx" — jQuery’s standard effects queue. Pass a custom name like "tasks" to dequeue from queues created with .queue("tasks", fn).
When jQuery runs a function you added with .queue(), it pauses the pipeline until you signal completion. Calling $(this).dequeue() or next() tells jQuery to run the following step. Without that signal, the queue stalls and later animations never start.
They achieve the same goal. next() is the modern pattern: .queue(function(next) { … next(); }). .dequeue() is the classic style: .queue(function() { $(this).dequeue(); }). Both continue the queue.
Yes for standard effects. jQuery automatically dequeues after each .animate(), .fadeIn(), and similar fx step. You only need manual .dequeue() (or next()) inside custom functions added with .queue(fn).
A jQuery object — the same collection you called it on. You can chain further methods, though it is most often called inside a queued callback to resume the pipeline.