Search code examples
javascriptjqueryzoomingjquery-eventskeydown

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


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?


Solution

  • 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.