Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
此代码禁用所有滚动:
document.ontouchmove = function(event) { event.preventDefault(); }
但是如何只禁用垂直滚动?
你有没有尝试过
yourdiv.onscroll = function(){ this.scrollTop = 0; this.scrollLeft = 0; }
当然这可能仍然显示滚动条,最好使用 css