Not sure where to put this or if there is a better way of doing this, in any case just putting this here, might be helpful
The only (easy) way I could fined to do this is to check current article's scroll position, if on top push it down by 1 pixel and if on bottom pull it up by 1 pixel, this will prevent the whole page from bouncing up and down when you swipe down/up while scroll position is on top/bottom.
$(document).on('touchstart', function(e){
var el = $(e.target).parents('article');
if(el.length) {
var scrollPos = el.scrollTop();
if(scrollPos == 0) el.scrollTop(1);
else if(el[0].scrollHeight-scrollPos == el[0].offsetHeight)el.scrollTop(scrollPos-1);
}
});
Not sure where to put this or if there is a better way of doing this, in any case just putting this here, might be helpful
The only (easy) way I could fined to do this is to check current article's scroll position, if on top push it down by 1 pixel and if on bottom pull it up by 1 pixel, this will prevent the whole page from bouncing up and down when you swipe down/up while scroll position is on top/bottom.
$(document).on('touchstart', function(e){ var el = $(e.target).parents('article'); if(el.length) { var scrollPos = el.scrollTop(); if(scrollPos == 0) el.scrollTop(1); else if(el[0].scrollHeight-scrollPos == el[0].offsetHeight)el.scrollTop(scrollPos-1); } });