层跟随鼠标移动
2016-06-16来源:易贤网

一下代码保存为.html运行试试看

<script >

function bb()

{

document.getelementbyid(test).style.top = event.clienty + document.body.scrolltop+5;

document.getelementbyid(test).style.left = event.clientx +document.body.scrollleft+5 ;

}

</script>

<body>

<div style=height:1000px; width:1000px; background:#ff0000; onmousemove=bb()>

<div id=test style= position:absolute;left:100px; top:110px; background-color:#cccccc; width:100px; height:100px;>aaa</div>

</div>

</body>

2025公考·省考培训课程试听预约报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息