jQuery Data - jQuery.dequeue() Method

Example

Use dequeue() to terminate a custom queue function:

$("div").queue(function () {
  $(this).toggleClass("red");
  $(this).dequeue();
});

Try It Yourself

Definition and Usage

The dequeue() method executes the next function in the sequence for matching elements.

Note:This is a low-level method; use .dequeue() More convenient.

Syntax

.dequeue(queueName)
Parameters Description
queueName Optional. A string value that contains the name of the sequence. The default is fx, the standard effect sequence.

Detailed Description

When calling .dequeue(), the next function in the sequence is removed and executed. This function in turn (directly or indirectly) triggers a call to .dequeue() so that the sequence can continue.