Skip to content

Commit 1aabccb

Browse files
mikesherovarschmitz
authored andcommitted
Effects Tests: Add shake visual test
Closes gh-1328
1 parent be9e087 commit 1aabccb

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

tests/visual/effects/shake.html

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>jQuery UI Effects Test Suite</title>
6+
<link rel="stylesheet" href="effects.css">
7+
<script src="../../../external/jquery/jquery.js"></script>
8+
<script src="../../../ui/effect.js"></script>
9+
<script src="../../../ui/effect-scale.js"></script>
10+
<script src="../../../ui/effect-shake.js"></script>
11+
<script>
12+
$(function() {
13+
$( "#btn" ).click(function() {
14+
$( ".shake" ).effect( "shake", {
15+
duration: +$( "#duration" ).val(),
16+
mode: "toggle"
17+
});
18+
});
19+
});
20+
</script>
21+
<style>
22+
#inputbox {
23+
background: green;
24+
}
25+
#selectbox {
26+
background: red;
27+
}
28+
#divbox {
29+
background: yellow;
30+
}
31+
#inputbox_abs {
32+
background: orange;
33+
position: absolute;
34+
top: 500px;
35+
left: 300px;
36+
}
37+
#divbox_abs {
38+
background: purple;
39+
position: absolute;
40+
top: 500px;
41+
left: 500px;
42+
}
43+
div.shake {
44+
background: lightblue;
45+
}
46+
47+
.margin {
48+
margin: 3px;
49+
}
50+
.border {
51+
border: 1px solid black;
52+
}
53+
.padding {
54+
padding: 10px;
55+
}
56+
</style>
57+
</head>
58+
<body>
59+
60+
<p>WHAT: A set of elements with various box-model properties, using the shake effect to toggle.</p>
61+
<p>EXPECTED: When clicking "Toggle", all elements should not change dimension nor position, aside from the expected shake animation, which should take the number of milliseconds specified to complete. At the end of the animation, all elements should hide.</p>
62+
<p>EXPECTED: Clicking "Toggle" a second time reverses the animation, first showing all elements at their original dimensions, and restoring them to their original state.</p>
63+
64+
<button id="btn">Toggle</button>
65+
<input id="duration" value="1000">
66+
<div id="divbox">
67+
<div class="shake margin">test</div>
68+
<div class="shake border">test</div>
69+
<div class="shake padding margin">test</div>
70+
</div>
71+
<div id="inputbox" class="margin">
72+
<div class="shake margin">test</div>
73+
<div class="shake margin border">test</div>
74+
<div class="shake padding">test</div>
75+
<input type="text" class="shake">
76+
</div>
77+
<div id="selectbox">
78+
<div class="shake">test</div>
79+
<div class="shake">test</div>
80+
<div class="shake">test</div>
81+
<select class="shake">
82+
<option value="a">a</option>
83+
<option value="abcdef">abcdef</option>
84+
</select>
85+
</div>
86+
<div id="inputbox_abs" class="margin">
87+
<div class="shake margin">test</div>
88+
<div class="shake margin border">test</div>
89+
<div class="shake padding">test</div>
90+
<input type="text" class="shake">
91+
</div>
92+
<div id="divbox_abs" class="margin">
93+
<div class="shake margin">test</div>
94+
<div class="shake margin border">test</div>
95+
<div class="shake padding">test</div>
96+
</div>
97+
98+
</body>
99+
</html>

tests/visual/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h2>Effects</h2>
4949
<ul>
5050
<li><a href="effects/all.html">All</a></li>
5151
<li><a href="effects/scale.html">Scale</a></li>
52+
<li><a href="effects/shake.html">Shake</a></li>
5253
</ul>
5354

5455
<h2>Menu</h2>

0 commit comments

Comments
 (0)