Example Hide
# jQuery UI Example β Hide
Use a custom effect to hide matched elements.
For more details about the `.hide()` method, see the API documentation [.hide()](#).
## .hide() Demo
Click the button to preview the effect.
jQuery UI Effects - .hide() Demo .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; } $(function() { // Run the currently selected effect function runEffect() { // Get effect type from var selectedEffect = $( "#effectTypes" ).val(); // Run the effect var options = {}; if ( selectedEffect === "scale" ) { options = { percent: 0 }; } else if ( selectedEffect === "size" ) { options = { to: { width: 200, height: 60 } }; } $( "#effect" ).hide( selectedEffect, options, 1000, callback ); }; // Callback function function callback() { setTimeout(function() { $( "#effect" ).removeAttr( "style" ).hide().fadeIn(); }, 1000 ); }; // Set effect from select menu value $( "#button" ).click(function() { runEffect(); return false; }); }); Blind Effect Bounce Effect Clip Effect Drop Effect Explode Effect Fold Effect Highlight Effect Puff Effect Pulsate Effect Scale Effect Shake Effect Size Effect Slide Effect Run Effect
(#)
YouTip