jQuery dequeue() method
Example
Remove the next function from the queue, then execute the function:
$("div").queue(function(){
$("div").css("background-color","red");
$("div").dequeue();
});
Try it »
Definition and Usage
The dequeue() method removes the next function from the queue, then executes the function.
A queue is one or more functions waiting to run.
The dequeue() method is usually used together with the queue() method. queue() the method.
An element can have several queues. Most of the time there is only one, the "fx" queue, which is the default jQuery queue.
**Note:** You should ensure that the dequeue() method is called after a function is added via queue(), so that the process can continue.
Syntax
$(
selector
).dequeue(
queueName
)
| Parameters | Description |
|---|---|
| queueName | Optional. Specifies the name of the queue.
The default is "fx", the standard effects queue. |
Try it - Example
Using queue-related methods together
How to use queue(), dequeue(), and clearQueue() together.
jQuery effects methods