nicholaswei

使用标准dom的方法:

document.oncontextmenu=function(oEvent){

     if(window.event){ //IE

         oEvent=window.event;

         oEvent.returnValue=false;

  }else{//FireFox

         oEvent.preventDefault();

     }

}

使用jquery的方法:

1. $(document).bind("contextmenu",function(){return false;});  //屏蔽右键

2. $(document).bind("selectstart",function(){return false;}); //屏蔽文本选择

3.$(document).keydown(function(){return key(arguments[0])}); //屏蔽复制按键 

分类:

技术点:

相关文章: