解决移动端出现弹窗背景禁止滚动(阻止苹果浏览器的默认行为)
第一种:
$("modal").on("touchmove",function(){
event.preventDefault();
});
注意:.modal是遮罩层的类名
$("body,html").css({ "height":"100%", "overflow":"hidden" });
$("body,html").css({ "height":"100%", "overflow":"auto" });
第二种:
弹出 fixed 弹窗后,在弹窗上滑动会导致下层的页面一起跟着滚动。
解决方法:
在弹出层加上 catchtouchmove 事件