一、概述:在咱們編程時會用到一些簡單的動畫效果,下面介紹一個:javascript
二、代碼以下:java
<!DOCTYPE HTML> <HTML> <HEAD> <TITLE> By ShaZhou </TITLE> </HEAD> <BODY> <div class="dotA" style="position:absolute">a</div> <div class="dotB" style="position:absolute">b</div> </BODY> <script type="text/javascript" src="jquery-1.11.3.js"></script> <script type="text/javascript"> $(document).ready(sssss()); function sssss(){ $(".dotA").animate({top:"100px"},500); $(".dotA").animate({top:"200px"},500); $(".dotA").animate({top:"300px"},500); $(".dotA").animate({top:"0px"},500); $(".dotB").animate({top:"300px"},500); $(".dotB").animate({top:"0px"},500); setTimeout(sssss,10); } </script> </HTML>
三、效果以下:jquery