PDA

View Full Version : tab content links...mystified



hugh
07-27-2009, 01:53 PM
Tab Content Script

http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

I've got this up and working nicely, great script. But I'm mystified by one thing....

The instructions/ code say links between the tabs should be written thus:

<li><a href="#" rel="tcontent2">Tab 2</a></li>

so, at the bottom of the contents of one of my tabs I added a link to go straight to the next tab (because the scroll means the tabs have gone out of view):

<li><a href="#" rel="tcontent2">Next...</a></li>

But this link doesn't go to the next tab at all, it just goes to the top of the page, and the page still displays tab 1 and its contents (the 'selected' tab)

Why does the link not work? The link code and destination is exactly the same, only the link text is changed?

Mystified....!

Hugh

ddadmin
07-27-2009, 05:58 PM
rel="tcontent2" only has special meaning when it's inserted inside links within the menu tabs container, not elsewhere on the page such as the content container. For the later, you need to call:


instance.expandit(tabid_or_position)

instead, such as:


<a href="javascript:myflowers.expandit(1)">Select 2nd Tab</a>

Where "myflowers" is the variable used for this tab content instance, and "1" denotes the 2nd tab. For more info, see the section "Dynamically selecting a tab anywhere on your page" on the script page (http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm).

hugh
07-27-2009, 06:06 PM
roger dodger, thanks for that, I'll give it a whirl

cheers, H