jQuery clearQueue() method
Example
Stop the remaining functions in the queue:
$("button").click(function(){
$("div").clearQueue();
});
Try it »
Definition and Usage
The clearQueue() method removes all items from the queue that have not yet run. Note that once a function starts running, it continues until it finishes.
Related methods:
- queue() - Demonstrate queued functions
- dequeue() - Remove the next function from the queue, then execute the function
**Tip:** Used together with stop() Unlike the method that applies only to animations, the clearQueue() method removes any queued function.
Syntax
$(
selector
).clearQueue(
queueName
)
| Parameters | Description |
|---|---|
| queueName | Optional. Specifies the name of the queue. |
默认是 "fx",标准效果队列。 |
Try it - Example
Using queue-related methods together
How to use queue(), dequeue(), and clearQueue() together.
jQuery effects methods