jqueryscrollctrl

Disable ctrl + mouse scroll on a webpage


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.