知道为什么快速移动光标时mouseleave事件没有注册吗? [英] Any idea why mouseleave event is not registering when moving the cursor fast?

查看:59
本文介绍了知道为什么快速移动光标时mouseleave事件没有注册吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选中以下调出:解决方案

尝试将mouseleave事件绑定到包装div而不是单个元素,因为该事件未在.controls show()触发器上悬停./p>

此示例 为您工作吗?

我建议也将z-index: 2;添加到.controls元素中.

Check this fiddle out: http://jsfiddle.net/abitdodgy/7rFb6/1/

When you move the cursor fast the mouseleave event does not register at times. Why is this happening?

When you hover over a selected image, a .controls layer appears that allows you to remove the selection. Once you unhover, though, the .controls layer should disappear. This does not always happen if you move the cursor really fast between the layers.

Try selecting the images and move the cursor very quickly between them and you will notice that this is happening. If the image is selected, the layer .controls should not be visible unless you are hovering over it.

Any ideas?

解决方案

Try to bind the mouseleave event to the wrapper div and not to the single element, since it's not hovered on .controls show() trigger.

Is this sample working for you?

I suggest to add z-index: 2; to the .controls elements, as well.

这篇关于知道为什么快速移动光标时mouseleave事件没有注册吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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