Last Updated: February 25, 2016
·
9.793K
· danhodkinson

jQuery - SlideUp to reveal

Normally with the jquery slide feature we use slideDown() to reveal and then slideUp() to hide.
But what if we want to reveal something by sliding it up? I went on a long journey of trying to animate this before stumbling on a very simple answer.

Instead of having your css of the element set to top: x, set it to bottom: x (you may need to nest it in another div to get the position absolutely sorted).

Now when you use your slideToggle() you will find it slides up to reveal!

Check out my quick and nasty jsFiddle here: http://jsfiddle.net/D7uT9/

Hope it helps somebody

dan.