I would like to disable the iOS overscroll in a webapp but still allow the body to be scrolled.
$(document).on('touchmove', function(e) {
e.preventDefault();
});
disables scrolling altogether (as one would expect).
Is there a way to do what I want to do?
I had pretty much the same issue. This should help you:
// Disable overscroll / viewport moving on everything but scrollable divs
$('body').on('touchmove', function (e) {
if (!$('.scrollable').has($(e.target)).length) e.preventDefault();
});
document.body.addEventListener('touchmove',function(e){
if(!$(e.target).hasClass("scrollable")) {
e.preventDefault();
}
});
Try this i just got in via google
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With