隨鼠標移動的圖片動態效果

<html>
  <head>
    <style type="text/css">
     .mystyle1{
      position:absolute;
      left:20;
      top:200;
     }
    </style>
 <script type="text/javascript">
  function move(x,y){
      myPicture.style.left = x;
      myPicture.style.top = y;
 }
</script>
  </head>
  <body οnmοusemοve="move(event.x, event.y)">
     正文內容
     <div class="mystyle1" id="myPicture"><img src="lover.jpg"></div>
    <br>
  </body>
</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章