gpt4 book ai didi

jQuery - iPad/iPhone - 禁用滚动后启用滚动

转载 作者:行者123 更新时间:2023-12-01 02:06:58 24 4
gpt4 key购买 nike

我使用以下方法禁用了 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com