简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM