快速移动光标时,jQuery,Mouseleave不会触发容器 [英] jQuery, Mouseleave not fired on container when moving cursor fast

查看:357
本文介绍了快速移动光标时,jQuery,Mouseleave不会触发容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一点问题。
那么,jsfiddle上的代码本身就会说明问题,以便引发错误,将鼠标快速移动到红框上(一边或另一边)。

一个简单的解释:
我有一个项目列表,当我把它们悬停时,我在它们的位置上显示一个覆盖div,我将一个mouseenter绑定到列表项上,并在覆盖div上绑定一个mouseleave,但是如果移动光标加快,mouseleave永远不会被触发。



任何想法?谢谢!



http://jsfiddle.net/QH3LV/22 /

解决方案

这是你正在寻找的。

放置隐藏的 div 里面 li 标记


I've got a bit of a bug. Well, the code on jsfiddle speaks for itself, to provoke the bug move your mouse quickly over the red box (to one side or the other).

A quick explanation: I have a list of items, when i hover them i show an overlay div on their positions, i bind an mouseenter on the list item, and an mouseleave on the overlay div, but if you move the cursor to fast, the mouseleave is never triggerd.

Any ideas? Thanks!

http://jsfiddle.net/QH3LV/22/

解决方案

This is what you are looking for.

There should be no problem in placing the hidden div inside the li tag

这篇关于快速移动光标时,jQuery,Mouseleave不会触发容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆