PDA

View Full Version : Tabbed Content: default tab?



touchnova
08-17-2008, 10:55 PM
1) Script Title:
Tab Content Script (v 2.2)

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

3) Describe problem:
I'm using tabbed content on a number of pages for a site I'm building. My goal is to have the first tab selected by default each time any of those pages are loaded. As it is now, if I visit a page and select the 3rd tab...the next page I visit will have the 3rd tab selected instead of the 1st. How can I adjust the persistence/default tab for this script? I currently have each page referencing its own .js and other support files in uniquely named directories....I thought that having multiple pages referencing the same .js file might lead to this, but it didn't help.

For what it's worth, I had a very similar issue (http://www.dynamicdrive.com/forums/showthread.php?p=157489) regarding the Accordion script, but attempting the same fix doesn't work here.

Thanks in advance.

TheJoshMan
08-17-2008, 11:08 PM
find this:


this.enabletabpersistence=true


and also make sure that you have the first tab set as default:


<ul id="flowertabs" class="shadetabs">
<li><a href="#" rel="tcontent1" class="selected">Tab 1</a></li>
<li><a href="#" rel="tcontent2">Tab 2</a></li>
<li><a href="#" rel="tcontent3">Tab 3</a></li>
<li><a href="#" rel="tcontent4">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>

touchnova
08-17-2008, 11:20 PM
Thanks for your quick reply, Nyne. I checked my files and it looks good on my end, including the persistence set to "true":


<ul id="countrytabs" class="shadetabs">
<li><a href="#" rel="country1" class="selected">Definition</a></li>
<li><a href="#" rel="country2">Duties</a></li>
<li><a href="#" rel="country3">Training</a></li>
<li><a href="#" rel="country4">Applications</a></li>
<li><a href="#" rel="country5">Appreciation</a></li>
</ul>

Ersh...what would you suggest next? Thanks again.

TheJoshMan
08-18-2008, 12:23 AM
I guess I should have been more clear... If the persistence is set to "true", then it is going to remember the last tab clicked. Set it to "false".

touchnova
08-18-2008, 12:48 AM
Thank, Nyne. I changed it to "false" and am still having the same result. I've now changed it back so all pages calling the tabscontent.js are pointed toward the same file...doesn't help either.

Just to make sure, is the value here correct?

this.currentTabIndex=0

Is there a difference between "=0" and "=[0]"? This is a total bummer...the site is essentially complete except for this. I appreciate your input though, Nyne, and hope maybe you have one more trick up your sleeve. Thanks.

For reference, here's the site (http://www.codyredmon.com/casa/index.html) in a testing space. To test it, just go to the Volunteer page and click the second or third tab, then go to the News page. You will see that whatever tab you clicked last on the Volunteer page is the one selected by default on the News page...