-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathanimation.html
74 lines (66 loc) · 1.53 KB
/
animation.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="Author" content="Tencent.AlloyTeam" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no,target-densitydpi=medium-dpi" />
<link rel="stylesheet" type="text/css" href="css/mui-base.css" />
<link rel="stylesheet" type="text/css" href="css/mui-slider.css" />
<style type="text/css">
.container{
padding: 10px;
}
h4{
margin: 10px 0;
}
.MUI{
position: absolute;
font-size: 80px;
font-weight: bold;
left:0;
top: 40%;
}
</style>
</head>
<div class="container">
<h4>Animation</h4>
<div id="MUI" class="MUI">MUI</div>
<input id="run" type="button" value="run" />
</div>
<script type="text/javascript" src="js/JM.js"></script>
<script type="text/javascript">
var $D = JM.dom;
var runBtn = $D.id("run");
var muiElem = $D.id("MUI");
runBtn.onclick = function(){
$D.setStyle(runBtn,"display","none");
muiElem.style.cssText = "";
setTimeout(function(){
J.Animation({
selector:"#MUI",
duration:1000,
use3d:true
}).setStyle({
"left":"40%",
"color":"blue"
}).transit(function(){
this.scale(.5).setStyle({
color:"red"
}).transit(function(){
this.rotate(180).setStyle({
opacity:0
}).transit(function(){
this.toOrigin().setStyle({
"opacity":1,
"color":"green"
}).transit(function(){
$D.setStyle(runBtn,"display","block");
});
});
});
});
},0);
}
</script>
</body>
</html>