Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mouseover/mouseenter not fired when scrolling [duplicate]

I have the fancy Apple mouse that detects finger movements such as "swipe" and "scroll".

Leaving the cursor fixed on the screen, but using my finger to scroll down my page, the cursor (although fixed) naturally moves over different elements, because the elements are moving themselves.

My problem is that when doing that, the appropriate mouseover/mouseenter callbacks don't get called when he mouse cursor is directly above them.

How can I solve this problem?

like image 804
Randomblue Avatar asked Sep 06 '11 20:09

Randomblue


1 Answers

Jquery's mousemove method is a nice solution here as it does get triggered when the mouse is rolled into an element as you scroll, even while the mouse has remained static.

You could even trigger the mouseenter event on mousemove as long as you include some kind of flag/state-check to ensure your mouseenter code doesn't get executed repeatedly on mousemove.

like image 145
atomless Avatar answered Oct 27 '22 00:10

atomless