爱程序网

坐标随鼠标移动 jquery简易版

来源: 阅读:

<html>

<span style="position:absolute" id="xy_test"></span>

</html>

<script>

 $(function(){

  $(document).mousemove(function(e){
  $('#xy_test').text(e.clientX+","+e.clientY);
  $('#xy_test').css('left',e.clientX+15+document.body.scrollleft - document.body.clientleft);
  $('#xy_test').css('top',e.clientY+15+document.body.scrollTop - document.body.clientTop);
  })

})

</script>

  模版世界:http://www.templatesy.com

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助