<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>jquery获取鼠标的位置</title>
<meta name="author" content="DeathGhost" />
<style>
    
    
</style>
<script src="jquery.js"></script> 
<script src="get.js"></script> 
</head>
    <body style="width:1000px;height:1000px">
        
    </body>
</html>

get.js:

$(function(){
        $("body").mousemove(function(e){
            console.info("x :" + e.pageX);
            console.info("y :" + e.pageY);
        });
});

 

效果:jquery获取鼠标移动时的位置

 

相关文章:

  • 2021-12-23
  • 2021-12-07
  • 2021-11-07
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2022-01-26
  • 2021-12-05
  • 2022-12-23
  • 2021-09-19
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案