一、当点击页面某个元素时弹出蒙层,此时应该锁死蒙层后方的页面不能滑动
<div class="content">触发蒙层</div>
<div class="pop">蒙层</div>
二、当点击 content 时,pop框显示,pop框后面的页面不可滚动
三、 j s 方法:
function moveStop(){//停止滚
window.ontouchmove=function(e){
e.preventDefault && e.preventDefault();
e.returnValue=false;
e.stopPropagation && e.stopPropagation();
return false;
}
},
function moveStart(){//可以滚动
window.ontouchmove="";
},
// 调用
$(".content").click(function(){
$(".pop").show();
moveStop();
});
$(".pop").click(function(){
$(".pop").hide();
moveStart();
});