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