|
1 <!DOCTYPE html> |
|
2 <html lang="en"> |
|
3 <head> |
|
4 <meta charset="UTF-8" /> |
|
5 <title>jQuery UI Effects - Animate Demo</title> |
|
6 <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> |
|
7 <script type="text/javascript" src="../../jquery-1.4.2.js"></script> |
|
8 <script type="text/javascript" src="../../ui/jquery.effects.core.js"></script> |
|
9 <link type="text/css" href="../demos.css" rel="stylesheet" /> |
|
10 <style type="text/css"> |
|
11 .toggler { width: 500px; height: 200px; position: relative;} |
|
12 #button { padding: .5em 1em; text-decoration: none; } |
|
13 #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; background: #fff; } |
|
14 #effect h3 { margin: 0; padding: 0.4em; text-align: center; } |
|
15 </style> |
|
16 <script type="text/javascript"> |
|
17 $(function() { |
|
18 $("#button").toggle( |
|
19 function() { |
|
20 $("#effect").animate({backgroundColor: '#aa0000', color: '#fff', width: 500}, 1000); |
|
21 }, |
|
22 function() { |
|
23 $("#effect").animate({backgroundColor: '#fff', color: '#000', width: 240}, 1000); |
|
24 } |
|
25 ); |
|
26 }); |
|
27 </script> |
|
28 </head> |
|
29 <body> |
|
30 |
|
31 <div class="demo"> |
|
32 |
|
33 <div class="toggler"> |
|
34 <div id="effect" class="ui-widget-content ui-corner-all"> |
|
35 <h3 class="ui-widget-header ui-corner-all">Animate</h3> |
|
36 <p> |
|
37 Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. |
|
38 </p> |
|
39 </div> |
|
40 </div> |
|
41 |
|
42 <a href="#" id="button" class="ui-state-default ui-corner-all">Toggle Effect</a> |
|
43 |
|
44 </div><!-- End demo --> |
|
45 |
|
46 <div class="demo-description"> |
|
47 |
|
48 <p>Click the button above to preview the effect.</p> |
|
49 |
|
50 </div><!-- End demo-description --> |
|
51 |
|
52 </body> |
|
53 </html> |