Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a DIV slide in and out?

I am currently learning jQuery. I'd like to know how to make an image slide in when you click on its edge, then click again and it slides away. Similar to this:

http://www.karenmillen.com/

If you see the right hand side and click, there is the effect that i'm looking for. I assume this will involve making a div and giving it a background image then using some jquery to make the div slide into view. Of course the div could have other content such as html. Any ideas?

Would the .slideDown() method work?

like image 500
Jeddizero Avatar asked Jan 04 '11 03:01

Jeddizero


2 Answers

if you want a div to slideDown() first it has to hidden. so use $("#div_Id").hide(); after that use $("#div_Id").slideDown('slow'); this will work

like image 144
Praneeth Avatar answered Oct 10 '22 18:10

Praneeth


Check out slideToggle

like image 32
Vadim Avatar answered Oct 10 '22 17:10

Vadim