手机端阻止页面滑动-模板

首先写一个函数

preventDefault : function(e) {
	e.preventDefault();
}

阻止页面滑动

document.addEventListener("touchmove",preventDefault,{passive: false});

打开页面滑动

document.removeEventListener("touchmove",preventDefault,{passive: false});
原文地址:https://www.cnblogs.com/pengxiangchong/p/12745508.html