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>
运行结果如下:
作者:Hackerman
出处:http://www.cnblogs.com/Hackerman/
出处:http://www.cnblogs.com/Hackerman/
本文版权归作者和博客园共有,欢迎转载。但必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。