I believe that you want to capture the touchmove event using the addEventListener function so that the parity does not “bubble”. Try the following:
var preventDefaultScroll = function(event) {
event.preventDefault();
window.scroll(0,0);
return false;
};
document.addEventListener('touchmove', preventDefaultScroll, false);
source
share