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