Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call an upside down jQuery.slideDown()?

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?

like image 361
Mark Rogers Avatar asked Jan 12 '11 20:01

Mark Rogers


People also ask

How do you toggle slideUp and 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.

How does jQuery slideDown work?

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.

How does jQuery slideUp work?

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.


1 Answers

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/

like image 120
German Rumm Avatar answered Oct 27 '22 00:10

German Rumm