1

I need help to find a solution for disabling the browser zoom in/out in all possible ways.

I have found this code snippet, which works perfectly in the way it was designed for:

$(document).keydown(function(event) {
    if (event.ctrlKey==true && (event.which == '61' || event.which == '107' || event.which == '173' || event.which == '109'  || event.which == '187'  || event.which == '189'  ) ) {
        event.preventDefault();
    }
});

$(window).bind('mousewheel DOMMouseScroll', function (event) {
    if (event.ctrlKey == true) {
       event.preventDefault();
    }
});

This perfectly blocks ctrl + 0 and the wheel, but is there any way to also disable the browser's built-in control panels or context menus?

Browser's control panels http://screenshot.cz/NPRTD/browsers-panels.png

spenibus
  • 4,339
  • 11
  • 26
  • 35
Zorak
  • 709
  • 7
  • 24
  • 1
    You can disable the context menu with by doing `return false` on the `oncontextmenu` event. But you cannot disabled the control panels that the browser has. [See this question.](http://stackoverflow.com/questions/27116221/prevent-zoom-cross-browser) – Spencer Wieczorek Sep 22 '15 at 22:54
  • 1
    Impossible! You cannot control that, it is browser functions and you have no control over it. If I want to zoom, well you cannot stop me! :) – Adam Buchanan Smith Sep 23 '15 at 00:00
  • you can do it for **mobile** with the viewport meta tag, setting "user-scalable=0".. sounds that that's what your looking for, but for desktop. [Detecting zoom level](http://stackoverflow.com/questions/1713771/how-to-detect-page-zoom-level-in-all-modern-browsers) might be somewhat relevant. – Steve Sep 23 '15 at 01:20

0 Answers0