废话不多说了直接给大家贴代码了。
代码如下:
代码
//www.jb51.cc
function key(){
if(event.shiftKey){
window.close();}
//禁止Shift
if(event.altKey){
window.close();}
//禁止Alt
if(event.ctrlKey){
window.close();}
//禁止Ctrl
return false;}
document.onkeydown=key;
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu(){
event.cancelBubble = true
event.returnValue = false;
return false;}
function norightclick(e){
if (window.Event){
if (e.which == 2 || e.which == 3)
return false;}
else
if (event.button == 2 || event.button == 3){
event.cancelBubble = true
event.returnValue = false;
return false;}
}
//禁右键
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmouown = norightclick; // for all others
//-->
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键特效
2. 3. onpaste="return false" 不准粘贴 4. oncopy="return false;" oncut="return false;" 防止复制 猜你在找的JavaScript相关文章 |