Chrome - Javascript防止默认的Ctrl + MouseWheel行为 [英] Chrome - Javascript prevent default Ctrl + MouseWheel behavior

查看:278
本文介绍了Chrome - Javascript防止默认的Ctrl + MouseWheel行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆