Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div hover not working when scrolling in 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?

like image 469
Tamás Pap Avatar asked Jan 19 '12 13:01

Tamás Pap


People also ask

Why Hover is not working on div?

You might have linked your stylesheet to your HTML file improperly. Some other CSS in the context of your project may be overriding the piece that you've given here. You might be running into browser compatibility issues with the :hover selector or something else in your code that is breaking the styling.

How do I enable scrolling on a div?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

Does hover work on Div?

To display div element using CSS on hover a tag: First, set the div element invisible i.e display:none;. By using the adjacent sibling selector and hover on a tag to display the div element.

How do I enable hover in CSS?

The :hover selector is used to select elements when you mouse over them. Tip: The :hover selector can be used on all elements, not only on links. Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :active selector to style the active link.


1 Answers

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.

like image 106
cdeszaq Avatar answered Sep 19 '22 08:09

cdeszaq