jquery中通过鼠标获取页面坐标

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<title>jquery_shijian_function.html</title>
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$(document).mousemove(function(e){
					$(".span").text("X:"+e.pageX+" , Y:"+e.pageY);
				});
			});
		</script>
	</head>
	<body>
		<div>
			<p>鼠标指针位于:<span class="span"></span></p>
		</div>
	</body>
</html>

你可能感兴趣的:(jquery中通过鼠标获取页面坐标)