PDA

View Full Version : Running 2 accordion scripts on same page?



CookieSlayer666
01-01-2010, 09:41 PM
1) Script Title:
Accordion Content script

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-apple.htm

3) Describe problem:

Hey everyone. :)

I wish to have both these scripts running on a single html page (php when I get around to fixing it that way), but can't quite figure out how to do it. I have a version of the apple style menu that I've styled to fit my site as a main menu, and I want to use the glossy style menu as a drop down for information in the main content area.
I have each script working fine separately, but when they are both on the same html page the content accordion 'headers' control the top menu.
I tried to duplicate the ddaccordion.js file and change the name to ddaccordion2.js, then had the content accordion call ddac...2.js instead, and also changed the submenu to submenu2. This didn't help. I saw somewhere else in the forum that someone was trying to use this script with a lightbox and they had to just change $ to j$ in the .js file, so I tried that and it killed it completely instead. :)

Any ideas on whether it's possible?
Thanks in advance, and this is a fantastic site. I've found it highly educational in my learning on programming and coding.

ddadmin
01-02-2010, 07:39 AM
The script supports multiple accordion menus on the same page, so you shouldn't need to duplicate ddaccordion.js multiple times. The key is just to make sure the CSS classes for the two menus are different. Please post a link to the problem page so we can check it out.

CookieSlayer666
01-02-2010, 07:49 PM
http://newgoldtown.com/objecttest2.html

I know it's not complete and the tags for the 2nd accordion are calling wrong but it's just to give an example of where it will be sat. The link below is the actual content that will be there.

http://newgoldtown.com/accordionexample.html

If it's just a case of changing the css classes that'd be fantastic. If you have examples I'd be very appreciative. :)

CookieSlayer666
01-02-2010, 09:37 PM
Actually, I managed to get it to work. When you mentioned the css classes, I experimented around with it a bit and got it working.

http://newgoldtown.com/objecttest3.html

Thanks for pointing me in the right direction! Very much appreciated. :)

ddadmin
01-02-2010, 10:13 PM
Glad to hear!