//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);});