zoukankan      html  css  js  c++  java
  • JS中实现网页中禁止下载图片

    我把这个网页的代码由贴出来:

    <html>

    <head>
    <title> fdsafdsafsda</title>
    <script language="javascript">
    <!--
    function MM()
    {
      
    if(event.srcElement.id=='an'//判断右击事件发生在哪个对像上面
    {
      alert(
    "对不起,本图片不能复制,版权所有!")
     document.oncontextmenu
    =new Function("event.returnValue=false;");   //禁用右键功能
    }
    else
    {
      document.oncontextmenu
    =new Function("event.returnValue=true;");  //启用右键功能

    }

    -->
    </script>
    </head>



    <body oncontextmenu="MM()">
      
    <p><center><img id="an" src="Wallpaper/2_12011134O.jpg"/ width="250px" height="160px"></center> </p>  
    </body>

    </html>
  • 相关阅读:
    asp.net 2.0 run
    Regular Expression
    assembly
    asp.net loading..
    session
    asp.net performance
    asp.net page order
    interface
    UVA 562 Dividing coins
    UVA 10003 Cutting Sticks
  • 原文地址:https://www.cnblogs.com/wantingqiang/p/1363949.html
Copyright © 2011-2022 走看看