屏蔽右键和页面缩放

bar参数变量化
This commit is contained in:
murmur 2024-06-30 20:25:40 +08:00
parent 7ddff30d86
commit e3943fe43e

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta charset="UTF-8" >
<title>amis demo</title>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta
@ -58,5 +58,40 @@
);
})();
</script>
<script>
//luwenjie hualun
document.oncontextmenu = function(){
event.returnValue = false;
}
window.addEventListener('mousewheel', function(event){
if (event.ctrlKey === true || event.metaKey) {
event.preventDefault();
}
},{ passive: false});
//firefox
window.addEventListener('DOMMouseScroll', function(event){
if (event.ctrlKey === true || event.metaKey) {
event.preventDefault();
}
},{ passive: false});
//+_
window.onload = function() {
document.addEventListener('keydown', function (event) {
if ((event.ctrlKey === true || event.metaKey === true)
&& (event.which === 61 || event.which === 107
|| event.which === 173 || event.which === 109
|| event.which === 187 || event.which === 189))
{
event.preventDefault();
}
}, false);
}
</script>
</body>
</html>