动态随鼠标移动的Tip

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>动态随鼠标移动的Tip</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style type="text/css">
        <!--
            *{font-size: 12px;}
            #Tip{
                display: none;
                background-color: #f6f7f7;
                color: #333333;
                line-height: 18px;
                border: 1px solid #e1e3e2;
                width: 250;
                height: 50;
                padding: 5px;
            }
        -->
    </style>
  </head>  
  <body>
  <script type="text/javascript">
  
      function showTip(e){
          var Tip=document.getElementById("Tip");
          if(Tip==null||Tip=='undefined')
              Tip=document.createElement("div");
          var target=e.srcElement?e.srcElement:e.target;
          Tip.innerHTML="<a href='#'style='text-decoration: none;' >"+target.innerHTML+"</a>";
          Tip.setAttribute("id","Tip");
          Tip.style.display="block";
          Tip.style.width=100;
          Tip.style.left=e.clientX+10;
          Tip.style.top=e.clientY+5;
          Tip.style.position="absolute";
          document.body.appendChild(Tip);
      }
      
      function closeTip(){
          var Tip=document.getElementById("Tip");
          Tip.style.display="none";
      }
      
  </script>
  <table width="100" border="1" cellpadding="0" cellspacing="0" bordercolor="#ffffff">
      <tr height="20">
          <td onmousemove="showTip(event)" onmouseout="closeTip()" align="center">
              <a href="#" style="text-decoration: none;">测试连接1</a>
          </td>
      </tr>
      <tr height="20">
          <td onmousemove="showTip(event)" onmouseout="closeTip()" align="center">
              <a href="#" style="text-decoration: none;">测试连接2</a>
          </td>
      </tr>
      <tr height="20">
          <td onmousemove="showTip(event)" onmouseout="closeTip()" align="center">
              <a href="#" style="text-decoration: none;">测试连接3</a>
          </td>
      </tr>
      <tr height="20">
          <td onmousemove="showTip(event)" onmouseout="closeTip()" align="center">
              <a href="#" style="text-decoration: none;">测试连接4</a>
          </td>
      </tr>
      <tr height="20">
          <td onmousemove="showTip(event)" onmouseout="closeTip()" align="center">
              <a href="#" style="text-decoration: none;">测试连接5</a>
          </td>
      </tr>                        
  </table>
  </body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值