Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery queue() method

jQuery queue() method

jQuery effects methods jQuery effects methods

Example

Display The length of the queue in an element:

$("span").text(div.queue().length);

Try it »


Definition and Usage

The queue() method displays the queue of functions to be executed on the selected elements.

A queue is one or more functions waiting to run.

The queue() method is usually used together with the dequeue() method. dequeue() 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.


Syntax

$(

selector

).queue(

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.

Calculate the queue length + loop through the queue
How to calculate the queue length + loop through the queue.


jQuery effects methods jQuery effects methods