I have a script like this:
$(document).ready(function(){
window.addEventListener('mousewheel', function(e){
e.preventDefault();
},{passive:false});
});
So now I need to make another function when on click of a button to override the above script and to "return" the default behavior.
I tested this:
$('#button').on('click', function(){
window.off('mousewheel');
});
And it's not working.
EDIT 2:
Just tested this and still not working:
$('#button').on('click', function(){
window.removeEventListener('mousewheel', function(e){
return true;
}, true);
});