5 <title>jQuery UI Effects - Effect demo</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.1.js"></script>
8 <script src="../../ui/jquery.ui.effect.js"></script>
9 <script src="../../ui/jquery.ui.effect-blind.js"></script>
10 <script src="../../ui/jquery.ui.effect-bounce.js"></script>
11 <script src="../../ui/jquery.ui.effect-clip.js"></script>
12 <script src="../../ui/jquery.ui.effect-drop.js"></script>
13 <script src="../../ui/jquery.ui.effect-explode.js"></script>
14 <script src="../../ui/jquery.ui.effect-fade.js"></script>
15 <script src="../../ui/jquery.ui.effect-fold.js"></script>
16 <script src="../../ui/jquery.ui.effect-highlight.js"></script>
17 <script src="../../ui/jquery.ui.effect-pulsate.js"></script>
18 <script src="../../ui/jquery.ui.effect-scale.js"></script>
19 <script src="../../ui/jquery.ui.effect-shake.js"></script>
20 <script src="../../ui/jquery.ui.effect-slide.js"></script>
21 <script src="../../ui/jquery.ui.effect-transfer.js"></script>
22 <link rel="stylesheet" href="../demos.css">
24 .toggler { width: 500px; height: 200px; position: relative; }
25 #button { padding: .5em 1em; text-decoration: none; }
26 #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; }
27 #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
28 .ui-effects-transfer { border: 2px dotted gray; }
32 // run the currently selected effect
33 function runEffect() {
34 // get effect type from
35 var selectedEffect = $( "#effectTypes" ).val();
37 // most effect types need no options passed by default
39 // some effects have required parameters
40 if ( selectedEffect === "scale" ) {
41 options = { percent: 0 };
42 } else if ( selectedEffect === "transfer" ) {
43 options = { to: "#button", className: "ui-effects-transfer" };
44 } else if ( selectedEffect === "size" ) {
45 options = { to: { width: 200, height: 60 } };
49 $( "#effect" ).effect( selectedEffect, options, 500, callback );
52 // callback function to bring a hidden box back
54 setTimeout(function() {
55 $( "#effect" ).removeAttr( "style" ).hide().fadeIn();
59 // set effect from select menu value
60 $( "#button" ).click(function() {
70 <div id="effect" class="ui-widget-content ui-corner-all">
71 <h3 class="ui-widget-header ui-corner-all">Effect</h3>
73 Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
78 <select name="effects" id="effectTypes">
79 <option value="blind">Blind</option>
80 <option value="bounce">Bounce</option>
81 <option value="clip">Clip</option>
82 <option value="drop">Drop</option>
83 <option value="explode">Explode</option>
84 <option value="fade">Fade</option>
85 <option value="fold">Fold</option>
86 <option value="highlight">Highlight</option>
87 <option value="puff">Puff</option>
88 <option value="pulsate">Pulsate</option>
89 <option value="scale">Scale</option>
90 <option value="shake">Shake</option>
91 <option value="size">Size</option>
92 <option value="slide">Slide</option>
93 <option value="transfer">Transfer</option>
96 <a href="#" id="button" class="ui-state-default ui-corner-all">Run Effect</a>
98 <div class="demo-description">
99 <p>Click the button above to show the effect.</p>