案例:jquery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery-1.11.1.min.js"></script>
5
<script> 
6
$(document).ready(function(){
7
  $("button").click(function(){
8
    $("div").animate({
9
      height:'toggle'
10
    });
11
  });
12
});
13
</script> 
14
</head>
15
 
16
<body>
17
18
<button>开始动画</button>
19
<p>默认情况下,所有 HTML 元素的位置都是静态的,并且无法移动。如需对位置进行操作,记得首先把元素的 CSS position 属性设置为 relative、fixed 或 absolute。</p>
20
<div style="background:#98bf21;height:100px;width:100px;position:absolute;">
21
</div>
22
23
</body>
24
</html>
25