Let's take a look at the effect chart that you want to implement
As shown in the GIF above, you can enter the number of animations you want to produce in the input box, and then click the Click me button to produce an effect. The effect is generated by several presets in the array. Here for demonstration convenience, no specific shape, such as can be replaced by some other iconfont to achieve the effect.
Realize the idea
Through $.queue and $.dequeue to achieve the animation queue access and removal results. First, input the array of corresponding quantity effect objects is formed by the number entered. Then the array is stored $.queue in, and finally through the click me button to trigger, one to remove the animation sequence, to achieve animation.
Attention
Here to note that, in a one out of the animation, used setInterval , do not need to clear the timer, otherwise it will affect the sequence, keep out.
Summarize
The above is the entire content of this article, interested friends to run their own operation will be easier to understand, if there are questions to exchange messages, I hope this article can help.