zoukankan      html  css  js  c++  java
  • 根据查询的资料,得到两种比较好的方法

    1)添加javascript:
    <script language="javascript">
    <!--

    <!--
    function document.oncontextmenu()
    {
    return false;
    }
    -->
    -->
    </script>
      在要屏蔽的页面的body中添加:
       <body  oncontextmenu= "nocontextmenu()">

    2)添加Javascript,到要屏蔽的页面
    <SCRIPT   language=javascript>  
      <!--  
      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.onmousedown   =   norightclick;     //   for   all   others  
      //-->  
      </SCRIPT>  

  • 相关阅读:
    Codeforces D
    Codeforces 899E
    Codeforces 898F
    算法笔记--字符串hash
    算法笔记--归并排序
    Codeforces D
    Codeforces 101628A
    牛客练习赛7 E 珂朵莉的数列
    算法笔记--树的直径 && 树形dp && 虚树 && 树分治 && 树上差分 && 树链剖分
    Codeforces 895C
  • 原文地址:https://www.cnblogs.com/kentyshang/p/697018.html
Copyright © 2011-2022 走看看