在Chrome中滚动时Div悬停不起作用 [英] Div hover not working when scrolling in chrome

查看:91
本文介绍了在Chrome中滚动时Div悬停不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看以下代码: http://jsfiddle.net/6JnJb/1/
我的问题是在chrome中,滚动时,如果鼠标悬停在div上,div不会改变其颜色。如果我将鼠标手动移动到div上(而不是在滚动时),则其颜色将变为红色。
在Firefox中可以完美运行,但在Chrome中则不能。
我能解决这个问题还是简单地解决Chrome的工作原理?

Please take a look at this code: http://jsfiddle.net/6JnJb/1/ My problem is that in chrome, the divs doesn't change their color if the mouse is over them, when scrolling. If I move the mouse over a div 'manually' (not when scrolling) than it changes it's color to red. In Firefox it works perfect, but not in Chrome. Can I solve this problem or simply this how Chrome works?

推荐答案

Chrome在以下情况下不会立即传播鼠标悬停事件滚动。确实没有任何办法可以解决此问题,因为它优先考虑滚动事件而不是特定元素上的悬停事件。

Chrome does not propagate mouseover events right away when scrolling. There really isn't any way around this issue, since it is giving priority to the scrolling event rather than the hover event on a particular element.

我看到的行为是悬停效果不会随着滚动鼠标的移动而移动,而是在滚动速度足够低时赶上。

The behavior I see is that the hover effect doesn't move with the still mouse on scroll but catches up when the scroll speed is sufficiently low.

这篇关于在Chrome中滚动时Div悬停不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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