我已使用以下方式禁用了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 - jQuery-iPad/iPhone-禁用后启用滚动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10803000/

10-14 16:59
查看更多