-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patheasing-demo.html
110 lines (99 loc) · 2.48 KB
/
easing-demo.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JQuery Easing Demo</title>
<style>
html {overflow-y:scroll}
body {
background-color:#eee;
font:normal 10px Sans-Serif;
color:#333;
text-align:center;
}
a {
color:#333;
text-decoration:none;
}
a:hover {color:blue}
h1 {
font:normal 18px Georgia,Serif;
margin:50px auto 30px;
width:840px;
}
#page-wrap {
border:4px solid black;
border-width:0 4px;
width:840px;
margin:30px auto;
text-align:left;
}
#page-wrap div {
position:relative;
background-color:black;
font:bold 10px/30px Tahoma,Verdana,Arial,Sans-Serif;
color:white;
width:140px;
padding:0 10px;
cursor:pointer;
margin:0 0 10px;
}
#page-wrap div:hover {color:#eee}
#page-wrap div.red {background-color:#900}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script>
$(function() {
$('#page-wrap').find('div').each(function(i) {
i = i + 1;
var a = this.id;
$(this).html(i + '. ' + a).on("click", function() {
$(this).animate({left:"680px"}, 2000, a, function() {
$(this).animate({opacity:0}, "fast", function() {
$(this).toggleClass('red').css({left:0}).delay(1000).animate({opacity:1}, "slow");
});
});
});
});
});
</script>
</head>
<body>
<h1>Demo Easing JQuery</h1>
<div id="page-wrap">
<div id="linear"></div>
<div id="swing"></div>
<div id="easeInQuad"></div>
<div id="easeOutQuad"></div>
<div id="easeInOutQuad"></div>
<div id="easeInCubic"></div>
<div id="easeOutCubic"></div>
<div id="easeInOutCubic"></div>
<div id="easeInQuart"></div>
<div id="easeOutQuart"></div>
<div id="easeInOutQuart"></div>
<div id="easeInQuint"></div>
<div id="easeOutQuint"></div>
<div id="easeInOutQuint"></div>
<div id="easeInSine"></div>
<div id="easeOutSine"></div>
<div id="easeInOutSine"></div>
<div id="easeInExpo"></div>
<div id="easeOutExpo"></div>
<div id="easeInOutExpo"></div>
<div id="easeInCirc"></div>
<div id="easeOutCirc"></div>
<div id="easeInOutCirc"></div>
<div id="easeInElastic"></div>
<div id="easeOutElastic"></div>
<div id="easeInOutElastic"></div>
<div id="easeInBack"></div>
<div id="easeOutBack"></div>
<div id="easeInOutBack"></div>
<div id="easeInBounce"></div>
<div id="easeOutBounce"></div>
<div id="easeInOutBounce"></div>
</div>
</body>
</html>