-
Notifications
You must be signed in to change notification settings - Fork 0
/
7_animate.html
47 lines (46 loc) · 997 Bytes
/
7_animate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta charset="utf-8">
<style>
#d1{
border:1px solid #aaa;
border-radius:6px;
background:#eee;
width:50px; height:50px;
position:absolute; top:120px; left:0;
}
</style>
</head>
<body>
<h1>animate</h1>
<button id="btn1">启动动画</button>
<button id="btn2">停止动画</button>
<div id="d1">abcd</div>
<script src="js/jquery-1.11.3.js"></script>
<script>
//测试animate支持哪些属性
// $("#btn1").click(function(){
// $("#d1").animate({
// //只支持单个数值的css属性
// //left:200,top、bottom、right
// //width:200,height
// //marginLeft:200,margin padding
// //opacity:0,
// //fontSize:64
// //borderRadius:25
// backgroundColor:"red"
// },2000)
// })
$("#btn1").click(function(){
$("#d1").animate({
width:200,
height:200
},2000)
})
//测试启动和停止动画
//测试延迟执行
</script>
</body>
</html>