In the web app I'm working on I want to do a little slide up notification, like on twitter or your desktop. jQuery's .slideDown
does exactly what I want, but it's upside down. The .slideUp
doesn't execute an upside down version of slideDown. Instead it hides stuff, like after your cleaning up an old message you've displayed with slideDown
.
So what's the simplest code to do an upside down slideDown()
in jQuery?
The slideToggle() method toggles between slideUp() and slideDown() for the selected elements. This method checks the selected elements for visibility. slideDown() is run if an element is hidden. slideUp() is run if an element is visible - This creates a toggle effect.
The slideDown() Method in jQuery is used to check the visibility of selected elements or to show the hidden elements. It works on two types of hidden elements: Elements hidden using jQuery methods. Elements hidden using display: none in CSS.
jQuery slideUp() Method The slideUp() method slides-up (hides) the selected elements. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page). Tip: To slide-down (show) elements, look at the slideDown() method.
Since you've put jquery-ui
into tags, here's jqueryUI solution (need to have Effects Core
)
$('#box').show('slide', {direction: 'down'});
Updated patrick's fiddle: http://jsfiddle.net/aVNL6/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With