jQuery clearQueue()Method
Examples
Stop the remaining functions in the queue:
$("button").click(function(){
$("div").clearQueue();
});
$("div").clearQueue();
});
Try it Yourself »
Definition and Usage
The clearQueue() method removes all items from the queue that have not yet run. Note that when a function starts running, it continues to run until it is finished.
Related Methods:
- queue()- Demonstrate the queued functions
- dequeue()- Remove the next function from the queue, and then execute the function
Tip:andstop()Unlike the method (which applies only to animations), the clearQueue() method removes any queued functions.
Syntax
$(selector).clearQueue(queueName)
| Parameter | Description |
|---|---|
| queueName | Optional. Specifies the name of the queue. The default is "fx", the standard effects queue. |
Try it Yourself - Examples
Use queue-related methods together
How to use queue(), dequeue() and clearQueue() together.
Other Extensions
jQuery Effects Methods