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,364
  • 12
  • 47
  • 76

4 Answers4

27

Something like this:

$("#menu").bind("mousewheel", function() {
    return false;
});
Mosh Feu
  • 26,720
  • 15
  • 83
  • 122
Mrchief
  • 73,270
  • 19
  • 138
  • 185
5

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

gentimouton
  • 135
  • 2
  • 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
  • 26,720
  • 15
  • 83
  • 122
odam.fm
  • 41
  • 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
  • 503
  • 3
  • 19