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>  

  • 相关阅读:
    hdu 14004
    hdu 1850 基础尼姆博奕
    hdu 1847 sg函数
    hdu 2177
    hdu 1527
    hdu 2897
    hdu 2516 取石子游戏
    hdu 1525 Euclid's Game
    hdu 2063
    hdu 1281 棋盘游戏
  • 原文地址:https://www.cnblogs.com/kentyshang/p/697018.html
Copyright © 2011-2022 走看看