弹出遮罩层后禁止底部页面滚动

stop(){
var mo=function(e){e.preventDefault();};
document.body.style.overflow='hidden';
document.addEventListener("touchmove",mo,false);//禁止页面滑动
},
/***取消滑动限制***/
move(){
var mo=function(e){e.preventDefault();};
document.body.style.overflow='';//出现滚动条
document.removeEventListener("touchmove",mo,false);
}

猜你喜欢

转载自www.cnblogs.com/sunhuinaxixi/p/10600927.html
今日推荐