移动端弹出层加遮罩后禁止滑动

//实现滚动条无法滚动
var mo=function(e){e.preventDefault();};

/***禁止滑动***/
function stop(){
        document.body.style.overflow='hidden';        
        document.addEventListener("touchmove",mo,false);//禁止页面滑动
}

/***取消滑动限制***/
function move(){
        document.body.style.overflow='';//出现滚动条
        document.removeEventListener("touchmove",mo,false);        
}

原理就是利用 overflow:hidden;  

原文地址:https://www.cnblogs.com/lpt1229/p/5937869.html