zoukankan      html  css  js  c++  java
  • 鼠标移过显示提示信息框(自动获取鼠标坐标)

    <head runat="server">
    <title></title>
    <script src="jquery-1.4.4.js" type="text/javascript"></script>
    <script src="jquery.sparkline.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var mouseX;
    var mouseY;
    function mouseLeave() {
    $("#infoDiv").css('display', 'none');
    }
    function mouseOver(obj) {
    mouseX = event.clientX;
    mouseY = event.clientY;
    $("#infoDiv").html('单击弹出详细信息!');
    $("#infoDiv").css('margin-left', mouseX);
    // $("#infoDiv").css('margin-top', '-80px');
    infoDiv.style.display = "block";
    }

    function mouseOver1(obj) {
    mouseX = event.clientX;
    mouseY = event.clientY;

    $("#infoDiv").html('单击弹出第二信息!');

    $("#infoDiv").css('margin-left', mouseX);
    // $("#infoDiv").css('margin-top', '-80px');
    infoDiv.style.display = "block";
    }
    </script>
    <script type="text/javascript">
    $(document).ready(function () {
    $(".cc").sparkline('html', { 'width': 160 });
    })
    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <div style="margin-left:500px; 270px;">
    <table><tr><td onmouseover="mouseOver1()" onmouseout="mouseLeave()">单击一:</td><td></td><td><a class="cc" onmouseover="mouseOver()" onmouseout="mouseLeave()">1,24,45,15,6,56,7,15,20,14,1,0,15,8</a></td></tr></table></div>

    <div id="infoDiv" style="display: none; position: absolute; margin-top:-80px; 180px; height: 25px; background-color: #F1F19B;"></div>
    </form>
    </body>
    </html>

  • 相关阅读:
    CF1202F You Are Given Some Letters...
    CF1178E Archaeology
    PTA (Advanced Level) 1005 Spell It Right
    PTA (Advanced Level) 1004 Counting Leaves
    Qt5——从零开始的Hello World教程(Qt Creator)
    PTA (Advanced Level) 1003 Emergency
    PTA (Advanced Level) 1002 A+B for Polynomials
    HDU 1272 小希的迷宫
    FZU 2150 Fire Game
    HihoCoder
  • 原文地址:https://www.cnblogs.com/wdw31210/p/2426926.html
Copyright © 2011-2022 走看看