PDA

View Full Version : Tabcontent help pls [ easy task ]



eroychiu
09-08-2008, 09:41 PM
1) Script Title:
Tab Content Script (v 2.2)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
3) Describe problem:

How to modify tabcontent.js that it will reload the whole page when clicking on the next tab ( from tab 1 to tab 2)?

ddadmin
09-08-2008, 10:50 PM
Not sure I understand. The whole purpose of Tab Content script is to display different content inline on the page, without reloading or going to a different page altogether. But since you asked, try something like:


<ul id="countrytabs" class="shadetabs">
<li onClick="location.reload()"><a href="#" rel="country1" class="selected">Tab 1</a></li>
<li onClick="location.reload()"><a href="#" rel="country2">Tab 2</a></li>
<li><a href="#" rel="country3">Tab 3</a></li>
<li><a href="#" rel="country4">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>

eroychiu
09-09-2008, 06:50 PM
Thank you, however, it is just reload the page and stay in the same tab.

How could I do this:

Tab 1 content --> Click Tab 2--> Reload --> Tab 2 content

ddadmin
09-10-2008, 07:00 AM
Hmmm try adding a delay before the page reloads. This gives the script ample time to have switched to the new tab:


<ul id="countrytabs" class="shadetabs">
<li onClick="setTimeout('location.reload()', 500)"><a href="#" rel="country1" class="selected">Tab 1</a></li>
<li onClick="setTimeout('location.reload()', 500)"><a href="#" rel="country2">Tab 2</a></li>
<li><a href="#" rel="country3">Tab 3</a></li>
<li><a href="#" rel="country4">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>

Make sure that persistence is also enabled when initializing the script on your page.

eroychiu
09-10-2008, 04:57 PM
Thank you for your reply.

It load the Tab2 content for a little while, then it reloads and back to content 1.:(

Tab 1 content --> Click Tab 2--> Reload --> Tab 2 content

any other suggestion? I appreciate it