且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用javascript / jquery禁用鼠标悬停事件?

更新时间:2023-10-30 12:53:40

您可以看看jquery的一个有趣的功能。 .. .one()这里是链接为它

You can have a look at an interesting feature of jquery ... .one() here is the link for it

说明:将一个处理程序附加到元素的事件中。每个元素最多执行一次处理程序。

Description: Attach a handler to an event for the elements. The handler is executed at most once per element.

第二个想法

可以给你一个想法,假设当鼠标悬停一次,只是在开始操作之前解除鼠标悬停事件的绑定,然后一旦操作结束,再次绑定它们...

I can give you one more idea, suppose when the mouse over is occurred once, just unbind the mouseover event before starting your operations, then as soon as the operations are over, bind them back again...