View Full Version : tab content - 6 on 1 page, switch tabs all at once?

06-25-2007, 10:05 PM
1) Script Title: Tab Content Script

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

3) Describe problem: hi guys, i have put six of these on one page, and i was wondering if its possible to make it so if i select tab 2 on the first tab script, all 4 scripts change to tab2?

its a great script as is, and this is just me thinking of the 'look' of my page, could look much nice if i could do this. you might get a better idea if you see what i'm doing here : www. selfcctv .co.uk

any idea?


06-28-2007, 06:31 AM
Hmmm no easy way that I can think of unfortunately. Each tab content instance is pretty much independent from the next. You can manually call:

expandtab(tabcontentid, tabnumber)

to have mutiple tabs selected when a link is clicked on, for example, but that's not what you're asking.

07-10-2007, 01:24 AM
I'm actually trying to do what you are referring to. Where would I put this code and how would I call it manually? Am I going to be using an OnClick script function?

Just stumbled upon this great script and am working with it now, appreciate any help.

07-10-2007, 05:08 AM
HI mkchronos:
Usage of expandtab() is actually explained on the script page. For example:

For example, to create a link that selects the 3rd tab of the Tab Content with UL id="maintab", you could use this code:

<a href="javascript: expandtab('maintab', 2)">Select 3rd tab of "maintab"</a>

As you can see, the tab count starts at 0, so 2 references the 3rd tab.

07-23-2007, 09:40 PM
Much appreciated, that was my problem. I was trying to use numeric representation instead of the names. Guess I should have read closer.

07-23-2007, 10:22 PM
Actually, as I read back through this post, this is more of what I ended up doing later on. In order to bypass the limit of the anchor tags, I ended up creating <img> tags for my label names, then attached the code for the onClick inside of them. That allowed me to force the tab of one sheet to open another.

<li class="selected"><a href="#" rel="detail1">
<img onClick="javascript: expandtab('charttab', 1)" src="/images/school_legend.png"/>">

Thus clicking on this detail1 link, would also open the second tab on the chart tabs.

Hope this helps.