案例: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
    var div=$("div");
9
    div.animate({height:'300px',opacity:'0.4'},"slow");
10
    div.animate({width:'300px',opacity:'0.8'},"slow");
11
    div.animate({height:'100px',opacity:'0.4'},"slow");
12
    div.animate({width:'100px',opacity:'0.8'},"slow");
13
  });
14
});
15
</script> 
16
</head>
17
 
18
<body>
19
20
<button>开始动画</button>
21
<p>默认情况下,所有 HTML 元素的位置都是静态的,并且无法移动。如需对位置进行操作,记得首先把元素的 CSS position 属性设置为 relative、fixed 或 absolute。</p>
22
<div style="background:#98bf21;height:100px;width:100px;position:absolute;">
23
</div>
24
25
</body>
26
</html>
27