0

I'm using the mousewheel.js jquery plugin https://github.com/jquery/jquery-mousewheel

How can I disable the 'mousewheel' event temporarily?

Or how can I unbind it and bind it after some time?

$(window).on('mousewheel', function(event) {

});

Thanks!

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
Abhijeet Ramgir
  • 51
  • 1
  • 2
  • 8
  • Very similar question here: http://stackoverflow.com/questions/6702116/jquery-mousewheel-how-to-disable – DeclanPossnett Feb 15 '17 at 12:59
  • `$(window).off('mousewheel')` ? [disconnecting events in jquery](https://learn.jquery.com/events/handling-events/#disconnecting-events) – barbsan Feb 15 '17 at 13:00
  • Here's the fiddle : https://jsfiddle.net/bfdyxobn/11/ I might be doing something stupid, but after using .off() on click event, it still triggers Thanks! – Abhijeet Ramgir Feb 15 '17 at 13:21

1 Answers1

0

To bind:

$(window).bind("mousewheel", function(e){ return false;});

To unbind:

$(window).unbind("mousewheel", function(e){ return false;});
DeclanPossnett
  • 376
  • 1
  • 5
  • 13