Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the expand direction on .toggle()?

I am using .toggle() jquery for expand/collapse.

Do you know how to change the expand/collapse direction from bottom to top instead of top-left to bottom-right? I am no jquery expert, I found the demo and use these codes...

Here is my working file: http://www.streetlightministries.ca/2013 - and click "Times & Location" on the top right corner. You will see it expanding from top-left to bottom-right. I rather to have it expand from bottom to top.

I would be really appreciate if you are able to help me out!

Thanks

like image 516
user1717475 Avatar asked May 28 '13 19:05

user1717475


3 Answers

For starters, I would use .slideToggle() instead of .toggle(). It just a simple collapse and expand. Try that out first and see if you like that result better.

like image 177
Smeegs Avatar answered Nov 10 '22 01:11

Smeegs


You are looking for slideToggle.

If you're lucky, you'll just need to change toggle() to slideToggle().

like image 20
Karl-André Gagnon Avatar answered Nov 10 '22 00:11

Karl-André Gagnon


Try this

$('blah').toggle('drop', {direction: 'right'}, 150)
like image 20
rolo1091 Avatar answered Nov 10 '22 00:11

rolo1091