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>

  • 相关阅读:
    log4j 配置文件详解
    Java 发送Get和Post请求
    java 基于百度地图API GPS经纬度解析地址
    Spring MVC 注解json 配置
    web.xml中classpath 解释
    【错误信息】springMVC No mapping found for HTTP request with URI
    栈和堆
    结构体和类的区别,联系
    Delegate,Block,Notification, KVC,KVO,Target-Action
    Protocol, Delegate
  • 原文地址:https://www.cnblogs.com/wdw31210/p/2426926.html
Copyright © 2011-2022 走看看