我使用以下方法禁用了 iPad 上的滚动:
function disableScrolling() {
document.ontouchmove = function(e){
e.preventDefault();
}
}
有没有办法简单地再次启用它?
这对于以下功能特别有用:
function enableScrolling() {
// enable scrolling
}
最佳答案
这应该有效,
var disableScroll = false;
function disableScrolling() {
disableScroll = true;
}
function enableScrolling() {
disableScroll = false;
}
document.ontouchmove = function(e){
if(disableScroll){
e.preventDefault();
}
}
关于jQuery - iPad/iPhone - 禁用滚动后启用滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10803000/