使用標準dom的方法:jquery
document.oncontextmenu=function(oEvent){dom
if(window.event){ //IEspa
oEvent=window.event;string
oEvent.returnValue=false;io
}else{//FireFoxevent
oEvent.preventDefault();function
}class
}select
使用jquery的方法:方法
1. $(document).bind("contextmenu",function(){return false;}); //屏蔽右鍵
2. $(document).bind("selectstart",function(){return false;}); //屏蔽文本選擇
3.$(document).keydown(function(){return key(arguments[0])}); //屏蔽複製按鍵