-
Notifications
You must be signed in to change notification settings - Fork 846
Expand file tree
/
Copy pathindex.html
More file actions
169 lines (140 loc) · 4.29 KB
/
index.html
File metadata and controls
169 lines (140 loc) · 4.29 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>jQuery Transit tests</title>
<script>
/*
* Dynamic script loading
*/
(function() {
var m = location.search.match(/jquery=([^&$]*)/);
var jQueryVersion = m ? m[1] : "1.8.1";
function addScript(src) {
document.write("<scr"+"ipt src='"+src+"'></scr"+"ipt>");
}
// Dynamically load jQuery depending on what's passed on get params.
if (jQueryVersion === "1.9.0b1") {
addScript("http://code.jquery.com/jquery-1.9.0b1.js");
addScript("http://code.jquery.com/jquery-migrate-1.0.0b1.js");
} else {
addScript("http://ajax.googleapis.com/ajax/libs/jquery/"+jQueryVersion+"/jquery.min.js");
}
addScript("../jquery.transit.js");
})();
</script>
<script src="test.js"></script>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div class='use'>
Use:
<a href='index.html?jquery=2.0.3'>jQ 2.0.3</a>
<a href='index.html?jquery=1.9.0b1'>jQ 1.9.0b1</a>
<a href='index.html?jquery=1.8.1'>jQ 1.8</a>
<a href='index.html?jquery=1.7.0'>jQ 1.7</a>
<a href='index.html?jquery=1.6.0'>jQ 1.6</a>
<a href='index.html?jquery=1.5.0'>jQ 1.5</a>
<button class='play-all'>Play all</button>
</div>
<div class='description'>
<h1>jQuery transit tests</h1>
<p class='version' id='jquery-version'></p>
<p>Since there's no reliable programmatic way to test for transitions, this
is a simple page set up so you can visually inspect effects
conveniently.</p>
</div>
<div class='tests'></div>
<script>
group('Transformations');
test('Translation', function($box) { $box.transition({ x: 20, y: 20 }); });
test('Rotate', function($box) { $box.transition({ rotate: 45 }); });
test('Rotate via string', function($box) { $box.transition({ rotate: '45deg' }); });
test('Skew X', function($box) { $box.transition({ skewX: 30 }); });
test('Skew Y', function($box) { $box.transition({ skewY: 30 }); });
test('Skew XY', function($box) { $box.transition({ skewY: 30, skewX: 30 }); });
test('Scale up', function($box) { $box.transition({ scale: 2 }); });
test('Scale down', function($box) { $box.transition({ scale: 0.5 }); });
group('3D transformations');
test('Rotate X', function($box) {
$box.transition({
perspective: '500px',
rotateX: 180
});
});
test('Rotate Y', function($box) {
$box.transition({
perspective: '500px',
rotateY: 180
});
});
test('Rotate X/Y', function($box) {
$box.transition({
perspective: '500px',
rotateX: 180,
rotateY: 180
});
});
group('Params');
test('Delay', function($box) {
$box.transition({ rotate: 45, delay: 150 });
});
test('Delay zero', function($box) {
$box
.transition({ x: 50, delay: 0 })
.transition({ x: 0 });
});
test('Ease (should be snappy)', function($box) {
$box.transition(
{ x: 100 }, 500,
'cubic-bezier(0,0.9,0.3,1)');
});
group('Chaining');
test('Queueing', function($box) {
$box
.transition({ x: 50 })
.transition({ x: 0 })
.transition({ y: 50 })
.transition({ y: 0 });
});
test('Duration 0 (should not flicker)', function($box) {
$box
.transition({ x: 50 }, 0)
.transition({ x: 0 }, 0)
.transition({ y: 50 }, 0);
});
group('Callbacks');
test('2nd param', function($box) {
$box.transition(
{ rotate: 45 },
function() { $box.html('OK'); });
});
test('3rd param', function($box) {
$box.transition(
{ rotate: 45 },
500,
function() { $box.html('OK'); });
});
test('as "complete"', function($box) {
$box.transition({
rotate: 45,
complete: function() { $box.html('OK'); }
});
});
group('Misc');
test('CSS with Transition', function($box) {
$box
.css({ x: -50 })
.transition({ x: 50 });
});
test('Opacity', function($box) {
$box
.transition({ opacity: 0 });
});
test('Transition of transform (no jump first time)', function($box) {
$box
.transition({ transform: "translateX(80px)" });
});
</script>
</body>
</html>