14

I am using jquery.mousewheel.js as a part of the jQuery jScrollPane plugin.

I want to disable the mousewheel at some point.

Could someone please recommend a jQuery statement that can do it?

Thank you!

Dimitri Vorontzov
  • 7,834
  • 12
  • 48
  • 76

4 Answers4

27

Something like this:

$("#menu").bind("mousewheel", function() {
    return false;
});
Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
Mrchief
  • 75,126
  • 20
  • 142
  • 189
5

Try using .unmousewheel(), it should also work.

gentimouton
  • 145
  • 3
  • 11
0

the container you must unbind is jspPane

In my case i needed to disable it only in the boxes inside #myOuterContainer

$('#myOuterContainer .jspPane').bind('mousewheel',function(){ return false; });
Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
odam.fm
  • 51
  • 7
0

For those who are not using the jQuery mousewheel plugin, this worked for me:

$("#inputID").bind("wheel", function() {
    return false;
});

The only difference is that the .bind method takes an argument of wheel instead of mousewheel

Note: The element I applied this to was on an input of type number

Kurt Leadley
  • 513
  • 3
  • 20