禁止copy、禁止Ctrl、禁止shift、禁止alt、禁止快捷菜单、禁止右键
代码如下:(建议保存到一个js文件中,例如:nocopy.js)
function iEsc(){ return false; }
function iRec(){ return true; }
function DisableKeys() {
if(event.ctrlKey || event.shiftKey || event.altKey) {
window.event.returnValue=false;
iEsc();}
}
document.ondragstart=iEsc;
document.onkeydown=DisableKeys;
document.oncontextmenu=iEsc;
if (typeof document.onselectstart !="undefined")
document.onselectstart=iEsc;
else{//camnpr.com
document.onmousedown=iEsc;
document.onmouseup=iRec;
}
//禁止右键
function DisableRightClick(www_camnpr_com){
if (window.Event){
if (www_camnpr_com.which == 2 || www_camnpr_com.which == 3)
iEsc();}
else if (event.button == 2 || event.button == 3){
event.cancelBubble = true
event.returnValue = false;
iEsc();}
}