0

This code disable all scrolling:

document.ontouchmove = function(event) {
    event.preventDefault();
}

But how to disable only vertical scroll?

1 Answers1

0

have you tried

yourdiv.onscroll = function(){
this.scrollTop = 0;
this.scrollLeft = 0;
}

of course this may still show scrollbars, best to use css

  • As with the css use overflow-x: hidden; aslo this might help: http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily oh! i think alos just adding the css might diable the div for vertical scrolling! – Simon Davies Feb 28 '13 at 22:07