Home › Forums › JavaScript › Disable mousewheel events › Reply To: Disable mousewheel events
May 17, 2016 at 4:34 pm
#241810
Participant
The other event listener is still in place and “blocking” the return true
. Give this a try, removing the event listener :
function disable() {
$(window).on('wheel.impair', function() {
return false;
});
}
function enable() {
$(window).off('wheel.impair');
}
Using a namespace (impair
here) makes it easier to unbind only a particular listener instead of disabling all events …