• jquery实现asp.net 网页鼠标所在位置


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mouseposition.aspx.cs" Inherits="test.mouseposition" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">  
        <title>Mouse Position using JQuery in Asp .Net</title>  
    </head>  
      
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>  
      
    <script type="text/javascript">
        $(function () {
            $(document).mousemove(function (e) {
                $('#lblMousePosition').html("X Axis: " + e.pageX + "<br/><br/>" + "Y Axis: " + e.pageY);
            })
        })  
    </script>  
      
    </head>  
    <body>  
        <form id="form1" runat="server">  
        <div>  
            <label id="lblMousePosition" style="background-color: Red;" />  
        </div>  
        </form>  
    </body>  
    </html>  

    运行结果如下:

  • 相关阅读:
    MySQL性能优化的最佳经验
    18个网站SEO建议
    sql之left join、right join、inner join的区别
    PHP与MYSQL事务处理
    Firefox上Web开发工具库一览
    SphinxSE的安装
    python XML
    python yaml
    C语言文本处理
    Linux strace命令
  • 原文地址:https://www.cnblogs.com/Hackerman/p/4200188.html
Copyright © 2020-2023  润新知