onmousemove

  1. <html>
  2. <head>
  3.  
  4. <script type="text/javascript">
  5. var i=1
  6. function moveright()
  7. {
  8. document.getElementById('header').style.position="relative"
  9. document.getElementById('header').style.left=i
  10. i++
  11. }
  12.  
  13. </script>
  14. </head>
  15. <body onmousemove="moveright()">
  16.  
  17. <h1 id="header">
  18. 请在页面上移动鼠标
  19. </h1>
  20.  
  21. </body>
  22. </html>