知道为什么快速移动光标时mouseleave事件没有注册吗? [英] Any idea why mouseleave event is not registering when moving the cursor fast?
尝试将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屋!