Chrome - Javascript防止默认的Ctrl + MouseWheel行为 [英] Chrome - Javascript prevent default Ctrl + MouseWheel behavior
问题描述
我尝试在JavaScript中使用Chrome阻止默认的 Ctrl + MouseWheel 缩放行为,其他浏览器使用 preventDefault()在鼠标滚轮事件的回调函数中,
和 stopPropagation()
并且完美,因为其他浏览器总是触发鼠标滚轮事件,但Chrome会不是。
I'm trying to prevent the default Ctrl+MouseWheel zoom behavior in Chrome with JavaScript, for the other browsers I use preventDefault()
and stopPropagation()
in the callback function for mouse-wheel event and works perfect because the other browser always trigger a mouse-wheel event but Chrome does not.
阅读这个问题
我发现 Ctrl + MouseWheel 可以作为resize事件捕获但在放大页面后,我无法阻止此行为。
Reading the question How to catch Zoom event with GWT and Chrome I found that Ctrl + MouseWheel can be caught as a resize event but after zooming the page so I can't prevent the behavior with this one.
是否在 Ctrl + 之前创建了其他事件MouseWheel 在Chrome中或是一个bug?
Is there other event created before Ctrl+MouseWheel in Chrome or is a bug?
推荐答案
不幸的是,拦截或阻止 CTRL在Chrome中 +滚轮(缩放)事件。
Unfortunately, it's impossible to intercept or block the CTRL + scrollwheel (zoom) event in Chrome.
这个问题正在被追踪 https://code.google.com/p/chromium/issues/detail?id=111059 。将问题列出以获取(进度)更新通知。
This issue is being tracked at https://code.google.com/p/chromium/issues/detail?id=111059. Star the issue to get notified of (progress) updates.
这篇关于Chrome - Javascript防止默认的Ctrl + MouseWheel行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!