Hi karan, You can disable browser zoom in and zoom out using this code. this works for me using keybaord CTRL+ and CTRL- as well CTRL+mouse wheel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$(document).ready(function(){ $(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' ) ) { alert('disabling zooming'); event.preventDefault(); // 107 Num Key + //109 Num Key - //173 Min Key hyphen/underscor Hey // 61 Plus key +/= } }); $(window).bind('mousewheel DOMMouseScroll', function (event) { if (event.ctrlKey == true) { alert('disabling zooming'); event.preventDefault(); } }); }); |
You can check…