PDA

View Full Version : Tab Content Script - links



wannebee
11-06-2006, 03:28 PM
1) Script Title: Tab Content Script

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

3) Describe problem: I would like to add a link in the content of tab 1 to link to tab 2 or 3.
I tried using the same link defined for the tabs, but it doesn't work elsewhere on the page.
<li><a href="#" rel="tcontent3">Tab 3</a></li>

Any help is appreciated.

Thanks!

ddadmin
11-06-2006, 11:21 PM
I should probably update this script to support things like this more generically, but in the meantime, such as link would look like this:


<a href="javascript:expandcontent(document.getElementById('maintab').getElementsByTagName('a')[1])">test</a>

Where "maintab" is the ID of the main UL element of the tab interface, and "1" indicates you want the second tab selected when the link is clicked on. "2" would mean the 3rd and so on.

wannebee
11-07-2006, 01:52 PM
Thank you ddadmin.

That is exactly what I was hoping to do! Guess I'll have to learn more about JavaScript...