
10-24-10, 03:54 PM
|
|
Newbie Coder
|
|
Join Date: Jul 2010
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
jQuery Accordion Menu
I have a simple horizontal accordion menu on my website: Jick | Short movies for short attention spans.
When you click on the black buttons (with white text on top) at the top or bottom, text either slides out to the left or the right.
I want the user to be able to click these buttons again and the text retracts back into the button and stays there. You can see it begins to do that, but then just slides back out again and I'm at a stand still.
If anyone can help me out it would be greatly appreciated, I'm struggling.
Thank you
Ryan
|

10-25-10, 12:59 AM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
This Javascript will work for the top menu but each bottom menu will need it's own function.
And each bottom menu function will need to check if any bottom menus are opened and close them.
Code for top menu:
Code for bottom menu:
Also the variables sw and sw1 need to be global.
You do that by putting them in the main page.
__________________
Jerry Broughton
Last edited by job0107; 10-25-10 at 01:05 AM.
|
|
The Following User Says Thank You to job0107 For This Useful Post:
|
|

10-25-10, 03:16 AM
|
|
Newbie Coder
|
|
Join Date: Jul 2010
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Wow you are amazing. Thank you so much. I liked how the bottom menu still had the accordion feature though. For example, when you're already on the share menu, and you click the flicks menu, then it just closes the share menu. I would like it still to open the flicks menu. Is there any way we can do that?
Thank you again,
Ryan
|

10-25-10, 09:09 PM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
Ok, this will work.
jquery.topmenu.js
jquery.bottommenu.js
As you can see, you need three global variables for each function to make it work.
jquery.topmenu.js uses swa, swb and prev.
jquery.bottommenu.js uses sw1a, sw1b and prev1.
Now you can add as many menu's as you want to either the top or bottom.
__________________
Jerry Broughton
Last edited by job0107; 10-25-10 at 09:19 PM.
|
|
The Following User Says Thank You to job0107 For This Useful Post:
|
|

10-26-10, 02:51 PM
|
|
Newbie Coder
|
|
Join Date: Jul 2010
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
You're the man. I see what you did now with adding the global variables. Thank you so much for the help.
|

10-26-10, 06:13 PM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
You're welcome.
I actually had fun doing it.
__________________
Jerry Broughton
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|