Help, I used $.animate to implement an event based on the page element mousdown. After doing it, I found a problem. After clicking the mouse multiple times in succession, the animation will be played repeatedly multiple times. The effect I want to achieve is that every time I click The animation is always played from the beginning. Multiple clicks will generate multiple mousdown events. How to judge whether the playback is completed based on the duration of the animation? If the playback is not completed, terminate the current animation and restart the playback?
When you click, terminate it first, and then continue the work, and it will be fine.