• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 實現Web頁面上的右鍵快捷菜單

    發表于:2007-06-21來源:作者:點擊數: 標簽:
    樣式代碼: style type="text/css" body{font: 9pt "宋體"; margintop: 0px ; color: red; background: #ffffff} a.{ font: 9pt "宋體"; cursor: hand; font-size: 9pt ; color: blue; text-decoration: none } a:active{ font: 9pt "宋體"; cursor: hand; c

       

    樣式代碼:


    <style type="text/css">
       body{font: 9pt "宋體"; margintop: 0px ; color: red; background: #ffffff}

       a.{ font: 9pt "宋體"; cursor: hand; font-size: 9pt ; color: blue; text-decoration: none }
       a:active{ font: 9pt "宋體"; cursor: hand; color: #FF0033 }
       a.cc:hover{ font: 9pt "宋體"; cursor: hand; color: #FF0033}
       .box{ font: 9pt "宋體"; position: absolute; background: LightGrey; }
      </style>


    html代碼如下:


      <table id="itemopen" class="box" style="DISPLAY:none">
       <tr>
        <td>彈出菜單</td>
       </tr>
       <tr>
        <td><a class="cc">Erickson的專欄</a></td>
       </tr>
       <tr>
        <td><a class="cc">CSDN</a></td>
       </tr>
       <tr>
        <td><a class="cc">Google 搜索</a></td>
       </tr>
       <tr>
        <td><a class="cc">搜狐</a></td>
       </tr>
       <tr>
        <td><a class="cc">Yahoo</a></td>
       </tr>
       <tr>
        <td><a class="cc">163 網站</a></td>
       </tr>
       <tr>
        <td><a class="cc">新浪網體育</a></td>
       </tr>
       </table>


    腳本代碼:


    右擊鼠標顯示快捷菜單:
      <script language="JavaScript">
       document.onmousedown = function popUp() {
        menu = document.all.itemopen
        if (event.button == 2) {
        newX = window.event.x + document.body.scrollLeft
        newY = window.event.y + document.body.scrollTop
        menu.style.display = ""
        menu.style.pixelLeft = newX
        menu.style.pixelTop = newY
        }
        else if (event.button == 1)
        {
         menu.style.display = "none"
        }
       }
      </script>


    屏蔽IE默認的WinForm快捷菜單:
      <script language="JavaScript">
       var message="";
       function clickIE()
       {
        if (document.all)
        {
         (message);
         return false;
        }
       }
       function clickNS(e)
       {
        if (document.layers||(document.getElementById&&!document.all))
        {
         if (e.which==2)
         {
          newX = window.event.x + document.body.scrollLeft
          newY = window.event.y + document.body.scrollTop
          menu = document.all.itemopen
          if ( menu.style.display == "")
          {
           menu.style.display = "none"
          }
          else
          {
           menu.style.display = ""
          }
          menu.style.pixelLeft = newX
          menu.style.pixelTop = newY
         }
         if (e.which==3)
         {
          (message);
          return false;
         }
        }
       }
       if (document.layers)
       {
        document.captureEvents(Event.MOUSEDOWN);
        document.onmousedown=clickNS;
       }
       else
       {
        document.onmouseup=clickNS;document.oncontextmenu=clickIE;
       }
       document.oncontextmenu=new Function("return false")
      </script>

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>