search

Home  >  Q&A  >  body text

javascript - A question about the mousdown event

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?

世界只因有你世界只因有你2768 days ago424

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-19 10:16:34

    When you click, terminate it first, and then continue the work, and it will be fine.

    reply
    0
  • Cancelreply