Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mouseleave not triggered when move mouse slowly

If you put a mouseleave listener on a div at the very top of the page, it will not fire on Chrome if you move the mouse slowly out of the top of the page (but it does work if you do it quickly). It's the same if you listen for the event on the document or body. Works fine in Firefox.

You can see the problem in this codepen. Uncomment the CSS padding to see my current workaround.

Any thoughts on why this is the case? Possibly a Webkit bug? Any other workarounds?

Update: this not related to jQuery - I reproduced the problem using the native mouseleave JavaScript event in Chrome.

Update: filed a Chromium issue: mouseleave not fired when move mouse slowly

like image 480
jackocnr Avatar asked Dec 03 '13 22:12

jackocnr


1 Answers

The codepen page in full mode works fine for me, counter increases also with slow movements. I tested it on Windows 7 with Chrome 31.0.

like image 159
Giuseppe Bertone Avatar answered Oct 21 '22 13:10

Giuseppe Bertone