ThomasCS ThomasCS - 1 year ago 207
HTML Question

jquery .slideToggle() horizontal alternative?

slideToggle does exactly what I want, only I want the slide to be horizontal.

I now have an horizontalhide/show and animation on click, but I would like to have the toggle options. So that when I click on the active link, it will play the animation reversed and hide itself.

What would be the best way to do this?

Answer Source

You can use the animate method:

$('#element').animate({width: 'toggle'});

http://jsfiddle.net/7ZBQa/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download