禁用浏览器鼠标右击事件全选事件

Posted friday69

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了禁用浏览器鼠标右击事件全选事件相关的知识,希望对你有一定的参考价值。

1、鼠标右键触发事件

  function click() 
  {  
   if(event.button==2) 
     { 
        alert(‘hello。。。。。。‘)  
     }  
  }  
  document.onmousedown=click  

2、让鼠标右键失效

<body oncontextmenu=self.event.returnValue=false> 

3、是页面文字内容无法选择或全选

<body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false"> 

以上是关于禁用浏览器鼠标右击事件全选事件的主要内容,如果未能解决你的问题,请参考以下文章