Queue and dequeue in jQuery are a group of useful methods, which are especially useful for a series of functions that require running in order. Special Functions that take some time, such as animate animation, ajax, and timeout
The process of queue
Article Introduction: the use of queue and dequeue in jquery.
Definitions and usage
The queue () method displays or operates a function queue that executes on a matching element.
The process of queue and dequeue is mainly:
1, queues the
In the core of jQuery, there is a group column control method, which consists of three methods: queue () dequeue () clearQueue, it is concise and easy to control the functions that require continuous and sequential execution. It is mainly used in
First, explain the meanings of these methods.
Queue (name, [callback]):When only one parameter is passed in, it returns and points to the queue of the First Matching Element (it will be a function array, and the queue name is fx by default); when
JQ queue ()/dequeue ()/clearqueue () control method detailed
First look at the example
JS HTML code
01020304050607
Queue (Name,[callback]): When only one parameter is passed in, it returns and points to the queue of the first
Let's explain the meaning of this set of methods.Queue (Name,[callback]): when only one parameter is passed in, it returns and points to the queue of the first matching element (it will be an array of functions and the queue name defaults to FX);
The queue module is divided into effects in jquery. searching the entire library will find that queue is only used in effects. js of the special effect module. Jquery extracts an independent namespace to the queue, indicating that, in addition to
//1, I first suggested an array of functions in which some columns need to be executed in sequence//2, then I define a callback function to execute the next function in the queue using the Dequeue method//3, then put this function array into the
A section about queueSource codeYou may find thatCodeSome problems exist. That is, if the frontend points to the end of the queue after leaving the queue;
An exception occurs. Therefore, to be able to use the queue, You need to modify the source
Data Structure-queue, data structure queueData Structure-queue
1. Queue DefinitionThe Queue is also a linear table with limited operations. Its operation limit is different from that of the stack. There are limits on both ends. insertion can only be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.