forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mmAnimate.html
85 lines (78 loc) · 3.11 KB
/
mmAnimate.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
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="avalon.js"></script>
<script src="http://apycom.com/ssc-data/themes/default/scripts/jquery.js" language="javascript"></script>
<script>
require("mmAnimate,ready!", function() {
var el = document.getElementById("test")
el.onclick = function() {
switch (el.innerHTML) {
case "resize":
avalon(el).fx({
width: 400,
height: 400,
background:"green"
}, 1200, function() {
avalon.log("complete")
el.innerHTML = "translation"
})
break;
case "translation":
avalon(el).fx({
top: 300,
left: 300,
width: 100,
height: 100
}, 1000, function() {
avalon.log("complete")
this.style.top = "40px"
this.style.left = "40px"
el.innerHTML = "toggle"
})
break
case "toggle":
avalon(el).hide(1000, function() {
avalon(el).show(1000, function() {
avalon.log("complete")
el.innerHTML = "fade"
})
})
break
case "fade":
avalon(el).fadeOut(1000, function() {
avalon(el).fadeIn(1000, function() {
avalon.log("complete")
el.innerHTML = "slide"
})
})
break;
case "slide":
avalon(el).slideUp(1000, function() {
avalon(el).slideDown(1000, function() {
avalon.log("complete")
el.innerHTML = "slideDown"
})
})
break;
}
}
})
</script>
<style>
#test{
width:200px;
height:200px;
background: red;
position: absolute;
}
</style>
</head>
<body>
<div ms-controller="animate">
<div id="test">resize</div>
</div>
</body>
</html>