forked from HaoZhang95/Python24
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic03.html
More file actions
49 lines (39 loc) · 1.28 KB
/
Copy pathbasic03.html
File metadata and controls
49 lines (39 loc) · 1.28 KB
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
48
49
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="./js/jquery-1.12.4.min.js"></script>
<script>
$(function () {
// jquery中的动画方法: $("div").animate(动画过程,动画时间,运动曲线,回掉函数)可以省略部分参数,但是不支持变色动画
// 1- 动画过程: css键值对 -- 写法{k : v, k : v}}
// 2- 时间毫秒
// 3- 运动曲线: swing(带缓冲效果)或者linear(匀速)
// 4- 回掉匿名函数
function func1() {
$("div").animate({
"width": "800px",
"height": "300px"
}, 3000, "swing", function () {
alert("动画执行完毕...");
})
}
func1()
})
</script>
<style>
div{
width: 200px;
height: 200px;
background: pink;
}
</style>
</head>
<body>
<div></div>
</body>
</html>