Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable scrolling on mouse wheel click on Firefox?

I don't want to disable the mouse scroll. I want to disable the click on the mouse wheel to scroll by moving the mouse up or down.

I've managed to do it for Chrome, IE, Opera and Safari, but not for Firefox.

Here's what I've used:

$(document).mousedown(function(e) {
    if(e.button == 1){  //also tried with if(e.which == 2){
        e.preventDefault();
        return false;
    }
});

Live demo

like image 237
Alvaro Avatar asked Aug 30 '25 16:08

Alvaro


1 Answers

You can disable this functionality by going to "about:config" and changing "general.autoScroll" to "false" (double-click on the record).

like image 66
Jon Avatar answered Sep 02 '25 05:09

Jon