I have a slide out mobile menu that has overflow set to auto so it will allow the user to scroll if the menu is too long.
I want to the user to be able to reach the end of the menu without the page scrolling on them.
I've tried each of these:
$(window).scroll(function(e){
e.preventDefault();
});
$(window).scroll(function(e){
e.preventDefault();
e.stopPropagation();
});
$(window).scroll(function(e){
return false
});
$('body').scroll(function(e){
e.preventDefault();
});
$('body').scroll(function(e){
e.preventDefault();
e.stopPropagation();
});
$('body').scroll(function(e){
return false
});
of course it test that the menu is open first. None of these prevent the page from scrolling.
I think this will do the trick see the example on the fiddle
Fiddle