站长素材 css3动画
建议使用谷歌浏览器或者是使用IE10及以上版本的浏览器
swing
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
5
<title>swing-站长素材(zzsucai.com)</title>
6
<style>
7
.div {
8
    width:300px;
9
    height:200px;
10
    margin:100px auto;
11
    background:url(images/zzsucai.png)
12
}
13
#animation {
14
-webkit-animation:swing 1s .2s ease both;
15
-moz-animation:swing 1s .2s ease both;
16
}
17
@-webkit-keyframes swing {
18
20%, 40%, 60%, 80%, 100% {
19
-webkit-transform-origin:top center
20
}
21
20% {
22
-webkit-transform:rotate(15deg)
23
}
24
40% {
25
-webkit-transform:rotate(-10deg)
26
}
27
60% {
28
-webkit-transform:rotate(5deg)
29
}
30
80% {
31
-webkit-transform:rotate(-5deg)
32
}
33
100% {
34
-webkit-transform:rotate(0deg)
35
}
36
}
37
@-moz-keyframes swing {
38
20%, 40%, 60%, 80%, 100% {
39
-moz-transform-origin:top center
40
}
41
20% {
42
-moz-transform:rotate(15deg)
43
}
44
40% {
45
-moz-transform:rotate(-10deg)
46
}
47
60% {
48
-moz-transform:rotate(5deg)
49
}
50
80% {
51
-moz-transform:rotate(-5deg)
52
}
53
100% {
54
-moz-transform:rotate(0deg)
55
}
56
}
57
</style>
58
</head>
59
<body>
60
<div id="animation" class="div"></div>
61
</body>
62
</html>
63
疯狂摆动