.mouseleave() with .delay() working together

后端 未结 3 1871
逝去的感伤
逝去的感伤 2021-01-12 05:22

I have a list of several \'triggers\' (

  • s), each trigger shows a specific DIV, and each DIV has \'close\' button.

    Now, I want to improve the us

  • 3条回答
    •  萌比男神i
      2021-01-12 05:49

      Use setTimeout instead of delay.

      Working demo: http://jsfiddle.net/J7qTy/

      From jQuery delay documentation:

      The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases.

    提交回复
    热议问题