The best jQuery UI examples - show (Show) Tutorial In 2024, In this tutorial you can learn .show () Demo,
Use custom effects to show matching elements.
For more information about .show()
details of the methods, see the API documentation .show () .
Click the button to preview effects.
<! Doctype html> <Html lang = "en"> <Head> <Meta charset = "utf-8"> <Title> jQuery UI Effects - .show () Demo </ title> <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <Script src = "// code.jquery.com/jquery-1.9.1.js"> </ script> <Script src = "// code.jquery.com/ui/1.10.4/jquery-ui.js"> </ script> <Link rel = "stylesheet" href = "http://jqueryui.com/resources/demos/style.css"> <Style> .toggler {width: 500px; height: 200px;} #button {padding: .5em 1em; text-decoration: none;} #effect {width: 240px; height: 135px; padding: 0.4em; position: relative;} #effect h3 {margin: 0; padding: 0.4em; text-align: center;} </ Style> <Script> $ (Function () { // Run the currently selected effect function runEffect () { // Derive effects type var selectedEffect = $ ( "#effectTypes") .val (); // Most of the effects do not need to type the default delivery options var options = {}; // Some special effects with the required parameters if (selectedEffect === "scale") { options = {percent: 100}; } Else if (selectedEffect === "size") { options = {to: {width: 280, height: 185}}; } // Run effects $ ( "#effect") .show (selectedEffect, options, 500, callback); }; // Callback function callback () { setTimeout (function () { $ ( "#effect: Visible") .removeAttr ( "style") .fadeOut (); }, 1000); }; // Set the value according to the selected menu effects $ ( "#button") .click (function () { runEffect (); return false; }); $ ( "#effect") .hide (); }); </ Script> </ Head> <Body> <Div class = "toggler"> <Div id = "effect" class = "ui-widget-content ui-corner-all"> <H3 class = "ui-widget-header ui-corner-all"> Display (Show) </ h3> <P> Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. Nulla lorem metus, adipiscing ut, luctus sed, hendrerit vitae, mi. </ P> </ Div> </ Div> <Select name = "effects" id = "effectTypes"> <Option value = "blind"> Shades effects (Blind Effect) </ option> <Option value = "bounce"> rebound effects (Bounce Effect) </ option> <Option value = "clip"> Clip effects (Clip Effect) </ option> <Option value = "drop"> Landing effects (Drop Effect) </ option> <Option value = "explode"> explosion effects (Explode Effect) </ option> <Option value = "fold"> folding effects (Fold Effect) </ option> <Option value = "highlight"> highlight effects (Highlight Effect) </ option> <Option value = "puff"> expansion effects (Puff Effect) </ option> <Option value = "pulsate"> beat effects (Pulsate Effect) </ option> <Option value = "scale"> Zoom effects (Scale Effect) </ option> <Option value = "shake"> Vibration effects (Shake Effect) </ option> <Option value = "size"> Size effects (Size Effect) </ option> <Option value = "slide"> slide effects (Slide Effect) </ option> </ Select> <a href="#" id="button" class="ui-state-default ui-corner-all"> run effects </a> </ Body> </ Html>