案例: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
  $("#start").click(function(){
7
    $("#box").animate({height:300},"slow");
8
    $("#box").animate({width:300},"slow");
9
    $("#box").queue(function () {
10
      $(this).css("background-color","red");  
11
      $(this).dequeue();
12
    });
13
    $("#box").animate({height:100},"slow");
14
    $("#box").animate({width:100},"slow");
15
  });
16
  $("#stop").click(function(){
17
    $("#box").clearQueue();
18
  });
19
});
20
</script>
21
</head>
22
<body>
23
24
<p><button id="start">Start Animation</button><button id="stop">Stop Animation</button></p>
25
<div id="box" style="background:#98bf21;height:100px;width:100px;position:relative">
26
</div>
27
 
28
</body>
29
</html>
30