jquery's animated list, jquery's queue, dequeue usage

Source: Internet
Author: User

//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 Myanimation queue on document (you can select any element, I just put this queue on the document for convenience)//4, and finally I started executing the first function in the queue the advantage of this is that the function array is linearly expanded, which is very convenient to add and subtract. varFunc=[    function() {$ (". P1"). Animate ({' Width ': 100},ANICB);},function() {$ (". P1"). Animate ({height:150},ANICB);},function() {$ (". P2"). Animate ({' Width ': 500},ANICB);},function() {$ (". P2"). Animate ({' Height ': 500},ANICB);},function() {$ (". P1"). Animate ({' Width ': 1000},ANICB);},];varanicb=function() {$ (document). Dequeue ("Myanimation");} $ (document). Queue ("Myanimation", FUNC); ANICB (); //Empty Queue//$ (document). Queue ("Myanimation", []);//add a new function and put it at the end.$ (document). Queue ("Myanimation",function() {$ (". P1"). Animate ({' Width ': 500},ANICB);}); $ (document). Queue ("Myanimation",function() {$ (". P2"). Animate ({' height ': 300},ANICB);});

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.