Description: The bounce effect bounces an element. When used with hide or show, the last or first bounce will also fade in/out.
-
bounce
-
distance (default: 20
)
The distance of the largest "bounce" in pixels.
-
times (default: 5
)
The number of times the element will bounce. When used with hide or show, there is an extra "half" bounce for the fade in/out.
Toggle a div using the bounce effect.
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
|
<title>bounce demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<p>Click anywhere to toggle the box.</p>
$( document ).click(function() {
$( "#toggle" ).toggle( "bounce", { times: 3 }, "slow" );
|