案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript"> 
5
$(document).ready(function(){
6
  function aniDiv(){
7
    $("#box").animate({width:300},"slow");
8
    $("#box").animate({width:100},"slow",aniDiv);
9
  }
10
  aniDiv();
11
  $(".btn1").click(function(){
12
    $(":animated").css("background-color","blue");
13
  });
14
});
15
</script>
16
<style> 
17
div
18
{
19
background:#98bf21;
20
height:40px;
21
width:100px;
22
position:relative;
23
margin-bottom:5px;
24
}
25
</style>
26
</head>
27
<body>
28
<div></div>
29
<div id="box"></div>
30
<div></div>
31
<button class="btn1">Mark animated element</button>
32
</body>
33
</html>
34