jquery實現上下四周運動

<html>
 <head>

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery
/jquery-1.4.min.js"></script>
        <script type="text/javascript">
          $(document).ready(function(){
            $("#red").animate({left:1237},2000);
            $("#red").animate({top:633},2000);
            $("#red").animate({left:0},2000);
            $("#red").animate({top:0},2000);
});
      
</script>
  
 </head>
 <body>
<div id="red" style="height:100px;width:200px;background-color:red;position:absolute;left:0;top:0"></div>
 </body>
</html>

 

發佈了37 篇原創文章 · 獲贊 9 · 訪問量 11萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章