The example in this article describes the solution to the continuous triggering and lagging execution of jQuery animation. Share it with everyone for your reference. The specific analysis is as follows:
When using slideUp, slideDown, animate and other animations in jQuery, if the target element is driven by external events, when the mouse triggers external element events quickly and continuously, the animation will be executed repeatedly with lag, which is indecent.
Solution:
1. Set the event on the triggering element to delayed processing to avoid the problem of delayed repeated execution (use setTimeout)
2. Stop all animations in advance when triggering an element's event, and then execute the corresponding animation event (use stop)
jquery stop:
I hope this article will be helpful to everyone’s jQuery programming.