View Full Version : Help on: Ajax Tabs Content Script (v 2.2)

11-04-2008, 10:00 PM
Script: Ajax Tabs Content Script (v 2.2)

In version 2.2, I am wondering if I could "Reload page and select 2nd tab using URL parameter" BY clicking on the TAB, not on the external link.

I understand it seems opposite the purpose of the tab function, but I need it to generate more page view.

Further, I have 2 set of videos which each containing 4 parts, if I enable tab persistence, how could the page automatically back to Part 1 when I finished Video#1 start a new Video#2?

Video #1:
Part1 Part2 Part3 Part4

Video #2:
Part1 Part2 Part3 Part4

Please let me know if you have any thing need to be cleared.

Thank you.

11-05-2008, 12:18 AM
Regarding the first question, if you must, what you can do is add an "onClick" event handler inside the tab's parent LI element that does this:

<ul id="countrytabs" class="shadetabs">
<li><a href="#" rel="#default" class="selected">Tab 1</a></li>
<li onClick="location='demo.htm?countries=1'"><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="external3.htm" rel="countrycontainer">Tab 3</a></li>
<li><a href="external4.htm" rel="#iframe">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>

In other words, you'd add:


where "demo.htm" should be the URL of the current page (the one you want reloaded), and "countries", the tab instance's variable (ie: var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")), and finally 1, the tab that should be selected (1=2nd tab). Do this for all the tabs that you want the default behavior changed.

Regarding part 2, I'm not sure I totally understand. Are you basically trying to dynamically change which tab is selected once a certain action is complete (ie: the playing of a video)?

11-19-2008, 05:48 PM
My question is

Assume I have two html pages (for example : 1.html , 2.html) , each of the page contains two tabs (for example: tab1 , tab2) .

how could I do this:

visit : 1.html tab1 --> tab2
visit : 2.html tab1 --> tab2

As the persistance is on, it will automatically jump to tab2 when I close the 1.html and start 2.html.

How could this problem could be solved?