PDA

View Full Version : Getting Switch Content Script II & Tab Content Script to work together



markfarrar
06-12-2007, 09:43 PM
1) Script Title:
Switch Content Script II
Tab Content Script

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

3) Describe problem:
I'm trying to get these two scripts, both of which work great independently, to work on the same page.

First, I added the Tab Content Switch, and this is what the page looked like at this point:

http://www.parvoemergencytreatment.com/index2.php

However, after I tried to add the Switch Content II script, all of the formatting of the tabs disappeared, as you can see from this version of the page:

http://www.ParvoEmergencyTreatment.com/

The text Shipping Disclaimer with the +/- sign next to it is where the expandable text with the Switch Content Script II is.

This works OK, but adding this script has totally screwed up the Tab Content formatting.

The four bullet points, starting with Parvaid and ending with Vibactra Plus, should be the four tabs, and the four images with corresponding heading text, should be the tab contents.

At the moment, they're all showing at the same time, with none of the formatting that the Tab Content script usually applies (e.g. the lines / box around everything).

As far as I can tell, it's to do with the contents of switchcontent.js and/or switchicon.js, rather than the contents of index.php, but that's as far as I've got with it.

Any ideas on how to get the two scripts to work side by side?

The files that may be required to look at this problem are attached, if you can't get them from the site itself, but if anything's missing, please let me know.

Thanks,



Mark

markfarrar
06-13-2007, 07:54 AM
Further to my earlier post, I thought I'd found the problem - there are several functions common to both scripts that share the same name. I therefore renamed the functions in one of the two scripts, hoping that this would fix the problem, but no such luck.

Also, so that I can continue developing this new site without it looking crazy, I've copied the version that demonstrates the problem I described in my first post to a new URL:

http://www.parvoemergencytreatment.com/index3.php

I do have a Plan B, if absolutely necessary, but I'd much rather get these two scripts to work side by side if I can.



Mark