jQuery deQueue() function removes the next function waiting to execute in the queue of the selected elements. To ensure that process is running, you must make sure that this method should be called only after the addition of a function with queue() method.

jQuery deQueue()

Here is the general syntax to use jQuery deQueue() method.

selector.deQueue(QueueName);

QueueName is an optional argument which is a string with the name of the queue. Default value is fx, which is the standard effects queue.

jQuery dequeue() example

Following example demonstrates the use of deQueue method. A queue of functions gets executed by clicking the start Animation button.

jQuery deQueue() method removes the next non-executed functions from the queue. If nothing is passed as an argument, then the deQueue method will remove the functions from the standard effects queue.

jQuery dequeue demo

jQuery deQueue() method is always used with queue() method and if not used, the queue will not be closed and you will get undesired result.

By admin

Leave a Reply

%d bloggers like this: