开发者

Is it possible to disable zoom using both keys as well as mousewheel in a page?

开发者 https://www.devze.com 2023-01-29 13:18 出处:网络
I want to disable zoom, be it Ctrl + -/+ or Ctrl + Scroll Wheel in all browsers. I tried using the code given in link. I also tried to disable the Ctrl key by using the following code:

I want to disable zoom, be it Ctrl + -/+ or Ctrl + Scroll Wheel in all browsers. I tried using the code given in link. I also tried to disable the Ctrl key by using the following code:

$(document).keydown(function(e){
    if(e.keyCode == 17)
        return false;
    });

But it doesn't work开发者_如何转开发. I actually don't want to alert the user that zoom is disabled, so I can't use the alert() inside the above code.

Any suggestions?


Zoom is there for a reason. Understand it, build around it, but don't try to disable it. In the end, it's a bowser feature that is out of your hands. You can hack and slash but I doubt you'll ever find a perfect or even stable solution for what you are asking.

0

精彩评论

暂无评论...
验证码 换一张
取 消