禁用右键菜单
document.oncontextmenu = function(){ return false; }
禁止选取的内容
document.onselectstart = function(){ return false; }
禁用复制
document.oncopy = function(){ return false; }
以上三大常用禁止方法,可以直接写在body中,如
<body oncontextmenu = "return false" ></body> <body onselectstart = "return false" ></body> <body oncopy = "return false" ></body>
禁用鼠标滚轮
document.onmousedown = function(e){ if ( e.which == 2 ){// 鼠标滚轮的按下,滚动不触发 return false; } if( e.which==3 ){// 鼠标右键 return false; } }
禁用键盘中的ctrl、alt、shift
document.onkeydown = function(){ if( event.ctrlKey ){ return false; } if ( event.altKey ){ return false; } if ( event.shiftKey ){ return false; } }
禁止网页另存为,在body下面增加如下代码
<noscript> <iframe src="*.htm"></iframe> </noscript>
评论前必须登录!
注册