// 禁止右键菜单
document.oncontextmenu = function () { return false; };
// 禁止文字选择
document.onselectstart = function () { return false; };
// 禁止复制
document.oncopy = function () { return false; };
// 禁止剪切
document.oncut = function () { return false; };
// 禁止粘贴
document.onpaste = function () { return false; };
//禁止缩放
document.body.addEventListener('touchmove', function (e) {
e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
}, { passive: false }); //passive 参数不能省略,用来兼容ios和android
移动端禁止一些特殊操作
于 2021-08-24 14:05:21 首次发布