Debian Codegraph @

demos/effect/hide.html

raw symbols SCIP
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery UI Effects - Hide Demo</title>
7 <link rel="stylesheet" href="../../themes/base/all.css">
8 <link rel="stylesheet" href="../demos.css">
9 <style>
10 .toggler { width: 500px; height: 200px; }
11 #button { padding: .5em 1em; text-decoration: none; }
12 #effect { width: 240px; height: 170px; padding: 0.4em; position: relative; }
13 #effect h3 { margin: 0; padding: 0.4em; text-align: center; }
14 </style>
15 <script src="../../external/requirejs/require.js"></script>
16 <script src="../bootstrap.js" data-modules="effects-all">
17 // run the currently selected effect
18 function runEffect() {
19 // get effect type from
20 var selectedEffect = $( "#effectTypes" ).val();
21
22 // Most effect types need no options passed by default
23 var options = {};
24 // some effects have required parameters
25 if ( selectedEffect === "scale" ) {
26 options = { percent: 50 };
27 } else if ( selectedEffect === "size" ) {
28 options = { to: { width: 200, height: 60 } };
29 }
30
31 // Run the effect
32 $( "#effect" ).hide( selectedEffect, options, 1000, callback );
33 };
34
35 // Callback function to bring a hidden box back
36 function callback() {
37 setTimeout(function() {
38 $( "#effect" ).removeAttr( "style" ).hide().fadeIn();
39 }, 1000 );
40 };
41
42 // Set effect from select menu value
43 $( "#button" ).on( "click", function() {
44 runEffect();
45 });
46 </script>
47 </head>
48 <body>
49
50 <div class="toggler">
51 <div id="effect" class="ui-widget-content ui-corner-all">
52 <h3 class="ui-widget-header ui-corner-all">Hide</h3>
53 <p>
54 Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi.
55 </p>
56 </div>
57 </div>
58
59 <select name="effects" id="effectTypes">
60 <option value="blind">Blind</option>
61 <option value="bounce">Bounce</option>
62 <option value="clip">Clip</option>
63 <option value="drop">Drop</option>
64 <option value="explode">Explode</option>
65 <option value="fade">Fade</option>
66 <option value="fold">Fold</option>
67 <option value="highlight">Highlight</option>
68 <option value="puff">Puff</option>
69 <option value="pulsate">Pulsate</option>
70 <option value="scale">Scale</option>
71 <option value="shake">Shake</option>
72 <option value="size">Size</option>
73 <option value="slide">Slide</option>
74 </select>
75
76 <button id="button" class="ui-state-default ui-corner-all">Run Effect</button>
77
78 <div class="demo-description">
79 <p>Click the button above to preview the effect.</p>
80 </div>
81 </body>
82 </html>