jQuery.queue()


Show or manipulate the queue of functions to be executed on the matched element.

jQuery.queue( element [, queueName ] )Возвращает: Array

Описание: Show the queue of functions to be executed on the matched element.

Note: This is a low-level method, you should probably use .queue() instead.

Примеры использования

jQuery.queue( element, queueName, newQueue )Возвращает: jQuery

Описание: Manipulate the queue of functions to be executed on the matched element.

  • Добавлен в версии: 1.3jQuery.queue( element, queueName, newQueue )

    • element
      Тип: Element
      A DOM element where the array of queued functions is attached.
    • queueName
      Тип: String
      A string containing the name of the queue. Defaults to fx, the standard effects queue.
    • newQueue
      Тип: Array
      An array of functions to replace the current queue contents.
  • Добавлен в версии: 1.3jQuery.queue( element, queueName, callback )

    • element
      Тип: Element
      A DOM element on which to add a queued function.
    • queueName
      Тип: String
      A string containing the name of the queue. Defaults to fx, the standard effects queue.
    • callback
      Тип: Function()
      The new function to add to the queue.

Note: This is a low-level method, you should probably use .queue() instead.

Every element can have one or more queues of functions attached to it by jQuery. In most applications, only one queue (called fx) is used. Queues allow a sequence of actions to be called on an element asynchronously, without halting program execution.

The jQuery.queue() method allows us to directly manipulate this queue of functions. Calling jQuery.queue() with a callback is particularly useful; it allows us to place a new function at the end of the queue.

Note that when adding a function with jQuery.queue(), we should ensure that jQuery.dequeue() is eventually called so that the next function in line executes.

Примеры использования