`

获取鼠标位置

阅读更多
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(document).mousemove(function(){
    $("span").text("X: " + event.pageX + ", Y: " + event.pageY);
  });
});

</script>
</head>
<body>
<p>鼠标指针位于: <span></span></p>
</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics