jQuery.dequeue(element [, queueName]) runs the next function waiting on an element’s queue. This tutorial covers the fx default, custom queue names, ending a custom .queue() step with $.dequeue(this), how it relates to .dequeue(), five examples, and try-it labs.
01
Advance
Next in line
02
Element
Raw DOM node
03
queueName
fx or custom
04
Custom steps
Must continue
05
vs .dequeue()
Prefer instance
06
Since 1.3
Low-level
Fundamentals
Introduction
jQuery keeps a queue of functions on each element — usually the fx effects queue that powers .animate(), fades, and slides. When one step finishes, the next should run.
Since jQuery 1.3, jQuery.dequeue(element [, queueName]) is the low-level utility that pulls the next function off that queue and executes it. Inside a custom .queue() callback you often see $.dequeue(this) so the chain can continue.
The official API notes that this is low-level: day to day you should prefer .dequeue() on a jQuery collection. Learn jQuery.dequeue so you can read docs and older samples, and so you understand what .dequeue() is doing under the hood. See also .queue() and the Utilities hub.
Concept
Understanding the jQuery.dequeue() Method
Call jQuery.dequeue(element) with a DOM element (not a jQuery object). jQuery removes the next function from that element’s queue and runs it. Pass an optional queueName; omit it to use "fx".
Custom queue functions must keep the pipeline moving. After your work (toggle a class, update text, start a timer), call jQuery.dequeue(this) or $(this).dequeue(). Skipping that call leaves later animations waiting forever.
💡
Beginner Tip
Think of jQuery.dequeue(el) as “run the next job for this element.” Prefer $(el).dequeue() in new code; use the static form when you already have a raw node or follow an example that uses $.dequeue(this).
Foundation
📝 Syntax
Signature (jQuery 1.3+):
jQuery
jQuery.dequeue( element [, queueName ] )
Parameters
element (Element) — a DOM element whose queue should advance.
queueName (String, optional) — queue to use. Defaults to "fx", the standard effects queue.
Return value
undefined — the static utility does not return a jQuery object for chaining.
Typical use inside .queue()
jQuery
$( "div" )
.animate({ left: "+=200px" }, 2000 )
.queue(function() {
$( this ).toggleClass( "red" );
jQuery.dequeue( this ); // or $( this ).dequeue();
})
.animate({ left: "10px" }, 700 );
Cheat Sheet
⚡ Quick Reference
Goal
Code
Advance default fx queue
jQuery.dequeue( elem );
Advance a named queue
jQuery.dequeue( elem, "tasks" );
Inside a queue callback
$.dequeue( this );
Preferred instance API
$( elem ).dequeue();
Modern next() style
.queue(function( next ) { … next(); })
Default queue
fx
Effects / animate pipeline
Argument
Element
Raw DOM node, not $()
Returns
undefined
No chaining from the static call
Prefer
.dequeue()
Instance method for most apps
Compare
📋 jQuery.dequeue() vs .dequeue() vs next()
jQuery.dequeue(el)
$(el).dequeue()
next() in .queue()
Level
Static utility
Instance method
Callback argument
Input
DOM element
jQuery collection
Function from jQuery
Return
undefined
jQuery object
n/a (you call it)
Best for
Low-level / legacy samples
Everyday code
Clear custom steps
Hands-On
Examples Gallery
Examples follow the official jQuery API pattern. Use View Output or Try It Yourself to explore each case.
📚 Getting Started
The classic animate + custom step pattern from the jQuery docs.
Example 1 — Official Demo: Animate, Toggle, Continue
After two animations, a custom queue step toggles a class, then $.dequeue(this) lets the final animate run.
Box slides right, moves up, toggles red, then returns
Without $.dequeue(this), the last animate would never start
How It Works
Standard .animate() steps dequeue themselves when finished. The function you add with .queue() does not — so you call $.dequeue(this) (alias for jQuery.dequeue) after your custom work.
Broken: fades out and stays hidden
Fixed: fades out, adds class, fades in again
How It Works
Custom queue callbacks are the #1 place beginners “lose” animations. Always finish with jQuery.dequeue(this), $(this).dequeue(), or next().
Example 4 — Custom Queue Name
Advance a named queue that is separate from fx.
jQuery
var el = document.getElementById( "box" );
jQuery.queue( el, "tasks", function( next ) {
$( el ).text( "Step 1" );
next();
});
jQuery.queue( el, "tasks", function() {
$( el ).text( "Step 2 — finishing with jQuery.dequeue" );
jQuery.dequeue( el, "tasks" );
});
jQuery.dequeue( el, "tasks" ); // start the custom queue
Step 1
Step 2 — finishing with jQuery.dequeue
Custom queues do not auto-start; call dequeue to begin
How It Works
Named queues stay off the effects pipeline. You must pass the same queueName to jQuery.queue and jQuery.dequeue. The first dequeue starts the run; later steps continue it.
Example 5 — jQuery.dequeue vs .dequeue()
Equivalent ways to continue the same queue.
jQuery
// Static utility (this tutorial)
.queue(function() {
$( this ).addClass( "a" );
jQuery.dequeue( this );
})
// Preferred instance method
.queue(function() {
$( this ).addClass( "b" );
$( this ).dequeue();
})
// Clearest modern style
.queue(function( next ) {
$( this ).addClass( "c" );
next();
})
All three continue the queue the same way
Prefer .dequeue() or next() in new projects
jQuery.dequeue(this) matches many official samples
How It Works
Pick one style per codebase. The static method is useful when documenting utilities or holding a raw element; instance .dequeue() and next() read more naturally in plugins and UI code.
Applications
🚀 Common Use Cases
Finish a custom .queue() step — toggle classes, update text, then continue animations.
Official-style samples — follow docs that show $.dequeue(this).
Raw DOM helpers — advance a queue when you already have an element reference.
Named task queues — run non-fx sequences with jQuery.dequeue(el, name).
Debugging stalled animations — check that every custom step dequeues.
jQuery.dequeue() has been part of jQuery since 1.3+. It works in every browser supported by your jQuery build — including modern evergreen browsers with jQuery 3.x. Queue behavior is implemented by jQuery, not by a separate browser API.
✓ jQuery 1.3+
jQuery.dequeue()
Stable low-level queue utility across supported jQuery versions. Prefer .dequeue() for element collections.
100%With jQuery 1.3+
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
jQuery.dequeue1.3+
Bottom line: Use to continue queues; prefer instance .dequeue() in application code.
Wrap Up
Conclusion
jQuery.dequeue() executes the next function on an element’s queue. It is the low-level twin of .dequeue() — essential to recognize in docs and custom queue callbacks, while most new code should call the instance method or next().
Next up: jQuery.each() for iterating arrays and objects.
Call dequeue (or next()) at the end of every custom queue step
Pass a real DOM element to jQuery.dequeue
Match queueName when using custom queues
Prefer .dequeue() or next() in new UI code
Use try-it labs to feel stalled vs fixed queues
❌ Don’t
Forget dequeue inside .queue(function(){ … })
Pass a jQuery object where an Element is required
Mix up fx with a custom queue name
Expect a chainable return from the static method
Clear a queue when you meant to advance it (.clearQueue() is different)
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about jQuery.dequeue
The low-level queue-advance utility.
5
Core concepts
→01
Runs
Next fn
Advance
DOM02
Needs
Element
Arg
fx03
Default
fx
Queue
!04
Custom
Must call
Continue
★05
Prefer
.dequeue()
Instance
❓ Frequently Asked Questions
jQuery.dequeue(element [, queueName]) removes the next function from the named queue on that DOM element and runs it immediately. It returns undefined. Added in jQuery 1.3. It is a low-level helper — prefer $(element).dequeue(queueName) in most code.
Same job, different call shape. jQuery.dequeue(elem) takes a raw DOM element (or this inside a queue callback). .dequeue() is called on a jQuery collection: $(elem).dequeue(). Official docs recommend .dequeue() for everyday use; jQuery.dequeue() is the underlying utility.
An optional string naming which queue to advance. It defaults to "fx" — jQuery’s standard effects queue used by .animate() and similar methods. Pass a custom name (for example "tasks") when you built the queue with jQuery.queue(elem, "tasks", fn) or .queue("tasks", fn).
When jQuery runs a function you added with .queue(), the pipeline pauses until you signal completion. Calling jQuery.dequeue(this) or $(this).dequeue() (or next() in the modern signature) starts the next step. Without that signal, later animations stay stuck.
No useful return — the API returns undefined. Instance .dequeue() returns the jQuery object for chaining; the static utility does not.
Prefer .dequeue() (or next() inside .queue(function(next){ ... next(); })). Use jQuery.dequeue(element) when you already hold a raw DOM node, are reading older examples that use $.dequeue(this), or are writing low-level queue utilities.
Did you know?
The official jQuery demo for jQuery.dequeue is almost identical to the .dequeue() demo — because the instance method is a thin wrapper around the same queue machinery. Learning one teaches the other; the static form just makes the element argument explicit.