div跟隨滑鼠懸浮顯示,div跟隨懸浮

來源:互聯網
上載者:User

div跟隨滑鼠懸浮顯示,div跟隨懸浮

<span style="font-size:18px;"><!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><style>     #hint{      width:198px;      height:200px;    border:1px solid #000000;      background:#99ff33;      position:absolute;      z-index:9;      padding:6px;      line-height:17px;      text-align:left;      top:1520px;     }  </style> <script type="text/javascript"> function showme(){       var oSon = window.document.getElementById("hint");       if (oSon == null) return;       with (oSon){        style.display = "block";        style.pixelLeft = window.event.clientX + window.document.body.scrollLeft + 6;        style.pixelTop = window.event.clientY + window.document.body.scrollTop + 9;       }      }      function hideme(){       var oSon = window.document.getElementById("hint");       if(oSon == null) return;       oSon.style.display="none";      }  </script> <body>     <a href="#" onmouseover="showme()">測試div跟隨滑鼠懸浮顯示1</a><br/><br/>   <a href="#" onmouseover="showme()" onmouseout="hideme()">測試div跟隨滑鼠懸浮顯示2</a><br/><br/>   <a href="#" onmouseover="showme()" onmouseout="hideme()" onmousemove="showme()">測試div跟隨滑鼠懸浮顯示3</a><br/><br/>   <a href="#" onmouseover="showme()" onmouseout="hideme()" >測試div跟隨滑鼠懸浮顯示4</a><br/><br/>   <div id="hint" style="display:none" onmouseout="hideme()">   哈哈哈哈哈哈   <input type="button" onclick="test()" value="按鈕"/>   <a href="index.jsp">連結</a>   </div>    </body>  </html></span>

效果:





聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.