jQuery 时间鼠标悬停在元素上(悬停)
我有一个悬停事件附加到几个链接,当你点击它时会出现一个框。
有没有一种方法可以让悬停事件仅在鼠标悬停在链接上超过 500 毫秒时触发?因此,目前,只要鼠标移到链接上,就会出现该框,但我希望只有当鼠标悬停在该框上 500 毫秒或更长时间时,它才会出现。
i have a hover event attached to a few links and when you go over it a box appears.
Is there a way that i can make the hover event only trigger if the mouse has been over the link for more then 500 ms? So currently as soon as the mouse goes over the link the box appears but i want it to only appear if the mouse has been over the box for 500 ms or longer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个很棒的 jQuery 插件,可以帮助您确定鼠标移动是否适合启动操作。
它称为 hoverIntent
Here's a great jQuery plugin that helps you decide if the mouse movement is appropriate for initiating an action.
It is called hoverIntent