Disable ctrl + mouse scroll on a webpage
Question
How can I disable CTRL + mouse scroll on web page with jquery?
I want to disable zoom in and zoom out on my web page!
Solution
Yes you can do this :
$(window).keydown(function(event)
{
if((event.keyCode == 107 && event.ctrlKey == true) || (event.keyCode == 109 && event.ctrlKey == true))
{
event.preventDefault();
}
$(window).bind('mousewheel DOMMouseScroll', function(event)
{
if(event.ctrlKey == true)
{
event.preventDefault();
}
});
});
This will only work for Firefox, Chrome and Opera. It will not work with Internet Explorer.
OTHER TIPS
This is not possible.
Instead, you should design your page to support zoom.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow