1、首先定义函数:
function bodyScroll(event){
event.preventDefault();
}
2、禁止滑动调用:
document.body.addEventListener('touchmove',bodyScroll,false);
document.body.style.position='fixed';
document.body.style.width='100%';
3、开启滑动调用:
document.body.removeEventListener('touchmove',bodyScroll,false);
document.body.style.position='initial';
document.body.style.width='auto';