简体   繁体   中英

Chrome / IE: 'mousemove' event triggered every couple of seconds with no movement / scroll / etc

This has to be the simplest jsFiddle ever: https://jsfiddle.net/os0xfbu2/3/

window.addEventListener(
    'mousemove', 
    function (e) { 
        // triggered even the mouse is not moving, the window is not scrolled, etc
    })

This is just a lousy mousemove event with nothing in page.

To replicate the behavior, just move your mouse in the HTML zone, and let it sit there, and don't move it and don't scroll the window .

You will see that every couple of seconds, the mousemove event is triggered a few times (about 2 in chrome, and in IE from 2 to 10 ten times sometimes).

Also notice in the jsFiddle that I printed out the X and Y document (absolute) coordinates, and they don't change.

My Chrome version is 42.0.2311.152m and my IE version is 11.0.9600.17633 (tested on both 32 and 64). A friend tested it in an older version of Chrome, it worked fine (no triggering) but after updated his Chrome version to the latest, the same problem started appearing.

Firefox is the only sane browser which doesn't trigger any 'move' event when nothing is moving.

If this is found in some specification somewhere, I quit my job as a programmer.

If not, let me know so I can submit this as a bug.

Have a look at this Tiborg. It's not looking like your faith in humanity / the state of the web is going to be revitalized...

https://code.google.com/p/chromium/issues/detail?id=327114

but at least the bug has already been reported... 2 years ago...

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