English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery effect queue() method

jQuery Effect Methods

The queue() method displays the function queue to be executed on the selected element.

In the queue, one or more functions wait to be executed.

Usually, the queue() method is used withdequeue()Methods are used together.

An element may have several queues. Usually, there is only one default jQuery queue.

Syntax:

$(selector).queue(queueName)

Example

Display the length of the queue:

$("span").text($("div").queue().length);
Test See‹/›

Use dequeue to end a custom queue function, allowing the queue to continue:

$("button").click(function(){
  $("div")
  .animate({left:"+=200px"}, 2000)
  .animate({top:"0px"}, 600)
  .queue(function() {
    $(this).toggleClass("blue").dequeue();
  })
  .animate({left:"10px", top:"300px"}, 700);
});
Test See‹/›

Parameter Value

ParametersDescription
queueName(Optional) Queue Name. Default isfx, standard effect queue

jQuery Effect Methods