Skip to content Skip to sidebar Skip to footer

Disable Ios Overscroll But Allow Body Scrolling

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 scro

Solution 1:

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();
 });

Solution 2:

document.body.addEventListener('touchmove',function(e){
     if(!$(e.target).hasClass("scrollable")) {
       e.preventDefault();
     }
 });

Try this i just got in via google

Post a Comment for "Disable Ios Overscroll But Allow Body Scrolling"