zoukankan      html  css  js  c++  java
  • 静态随鼠标移动的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">
    <!--
    #Tip
    {
    display
    : none;
    background-color
    : #f6f7f7;
    color
    : #333333;
    font-size
    : 12px;
    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");
    Tip.style.display
    ="block";
    Tip.style.left
    =e.clientX+10;
    Tip.style.top
    =e.clientY+5;
    Tip.style.position
    ="absolute";
    }

    function closeTip(){
    var Tip=document.getElementById("Tip");
    Tip.style.display
    ="none";
    }

    </script>
    <div id="Tip">这里显示出全部内容</div>
    <table width="100%">
    <tr>
    <td onmousemove="showTip(event)" onmouseout="closeTip()">
    <a href="#" style="text-decoration: none;">测试连接</a>
    </td>
    </tr>
    </table>
    </body>
    </html>

    实例效果图:

  • 相关阅读:
    vue搭建开发环境
    一些意想不到的小bug。
    小程序开发中遇到的问题
    Per相关图书推荐
    MATLAB相关图书推荐
    CSS相关图书推荐
    Cocos2d相关图书推荐
    JSP相关图书推荐
    Fortran相关图书推荐
    R语言相关图书推荐
  • 原文地址:https://www.cnblogs.com/BigIdiot/p/2340393.html
Copyright © 2011-2022 走看看