zoukankan      html  css  js  c++  java
  • html iframe禁用右键

    <!doctype html>
    <html lang="en">
     <head>
      <meta charset="UTF-8">
      <meta name="Generator" content="EditPlus®">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
      <title>Document</title>
     </head>
    
    
     
       <script type="text/javascript">
          document.oncontextmenu = function(){     
              return false;
          } 
    
     
      </script>
    
    
    
     <body  >
     
    
     
    
      <iframe id="ifm" height="100%" width="100%" marginwidth ="0" marginheight="0"   src="http://localhost/abc.html"></iframe>
     
     </body>
    
      <script type="text/javascript">
          var iframe = document.getElementById('ifm');
    iframe.onload=function(){
      iframe.contentWindow.document.oncontextmenu=function(){return false;};
      iframe.contentWindow.document.onselectstart=function(){return false;};
    };
    
      </script>
    
    </html>
    document.oncontextmenu = function(){     
              return false;
    }


     var iframe = document.getElementById('ifm');
    iframe.onload=function(){
      iframe.contentWindow.document.oncontextmenu=function(){return false;};
      iframe.contentWindow.document.onselectstart=function(){return false;};
    };
  • 相关阅读:
    Android AdapterView View的复用机制 分析
    go12---interface
    go11---方法method
    go10---struct
    go09---defer
    go8---函数function
    go7---map
    go6---slice切片
    go5--数组
    go4--break,continue + 标签
  • 原文地址:https://www.cnblogs.com/shihaiming/p/13273952.html
Copyright © 2011-2022 走看看