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

标签 javascript html google-chrome internet-explorer events

这必须是最简单的 jsFiddle:https://jsfiddle.net/os0xfbu2/3/

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

这只是一个糟糕的鼠标移动事件,页面中没有任何内容。

要复制该行为,只需将鼠标移动到 HTML 区域,然后将其放在那里,然后不要移动鼠标,也不要滚动窗口

您将看到每隔几秒,mousemove 事件就会触发几次(在 chrome 中大约为 2 次,在 IE 中有时会触发 2 到 10 次)。

另请注意,在 jsFiddle 中,我打印出了 X 和 Y 文档(绝对)坐标,并且它们没有改变。

我的 Chrome 版本是 42.0.2311.152m,我的 IE 版本是 11.0.9600.17633(在 32 和 64 上测试)。一位 friend 在旧版本的 Chrome 中进行了测试,运行良好(没有触发),但是在将其 Chrome 版本更新到最新版本后,开始出现同样的问题。

Firefox 是唯一一款在没有任何内容移动时不会触发任何“移动”事件的正常浏览器。

如果在某个规范的某个地方发现了这一点,我就会辞掉程序员的工作。

如果没有,请告诉我,以便我可以将此作为错误提交。

最佳答案

看看这个蒂堡。 看起来你对人性/网络状态的信心不会重振......

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

但至少这个 bug 已经被报告过... 2 年前...

关于javascript - Chrome /IE : 'mousemove' event triggered every couple of seconds with no movement/scroll/etc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30234963/

相关文章:

jquery - 点击事件加载页面

javascript - 单元格上的 BootStrap 完整日历 CSS

google-chrome - 为什么我在 chrome 开发者工具中看不到 301 重定向?

javascript - iframe src 属性随参数变化

javascript - 我能以某种方式从 JavaScript 文件调用 JSTL 函数吗?

javascript - 如何在我的模板中设置谷歌地图?

javascript - 谷歌浏览器 : Simultaneously 'smooth' scrollIntoView() with more elements doesn't work

javascript - 错误 : Could not locate the bindings file better-sqlite3. Node

javascript - Vuejs nuxt 仅在浏览器中导入

css - 在 Chrome 中打印会更改我的页面布局