This code disable all scrolling:
document.ontouchmove = function(event) {
event.preventDefault();
}
But how to disable only vertical scroll?
have you tried
yourdiv.onscroll = function(){
this.scrollTop = 0;
this.scrollLeft = 0;
}
of course this may still show scrollbars, best to use css
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.