zoukankan      html  css  js  c++  java
  • 收藏:FLASH中键检测与右键屏蔽

    原文:http://space.flash8.net/space/?591172/viewspace-708726.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta. http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>FLASH中键检测与右键屏蔽</title>
    <script. type="text/javascript" src="swfobject.js"></script>
    </head>

    <body>
     <div id="flashcontent"></div>
     <script. type="text/javascript">
        var so = new SWFObject("FL.swf", "flash", "800", "600", "9", "#CCCCCC");
      so.addParam("wmode", "opaque");
      so.write("flashcontent");
      function callFlash(){
       //alert("中键");
       document.getElementById("flash").onClick();
      }
      if(window.addEventListener){
       window.addEventListener("mousedown",function(e){
        if(e.button==1)callFlash();
        //屏蔽右键
        if(e.button==2){    
         if (e.stopPropagation) e.stopPropagation();
         if (e.preventDefault) e.preventDefault();
         if (e.preventCapture) e.preventCapture();
            if (e.preventBubble) e.preventBubble();
        }
       },true);
      }else{
       document.getElementById("flashcontent").onmousedown=function(){
        if(event.button==4)callFlash();
        //屏蔽右键
        if(event.button==2){
         document.oncontextmenu=function(){return false;};
         this.setCapture();
         this.onmouseup=function(){
          this.releaseCapture();
         }
        }
       }
      }
     </script>
    </body>
    </html>

  • 相关阅读:
    Hihocoder #1014 : Trie树
    Codevs 1298 凸包周长
    洛谷 P1355 神秘大三角(计算几何基础)
    Cogs 1688. [ZJOI2008]树的统计Count(树链剖分+线段树||LCT)
    Poj 2887 Big String(块状数组)
    P1449 后缀表达式
    P3478 [POI2008]STA-Station
    P1533 可怜的狗狗
    P2073 送花
    P1014 Cantor表
  • 原文地址:https://www.cnblogs.com/personnel/p/4583062.html
Copyright © 2011-2022 走看看