PDA

View Full Version : AjaxTabContent



drecute
08-01-2008, 03:42 PM
1) Script Title: Linking to specific tab

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

3) Describe problem: Default
Firstly i want to thank DD for this code.
This post is from the ajaxtabcontent example. I have looked at the solutions above but they all did not work for me. I want to link to a specific ajaxtab from the same page. This is an except from the code;

//this code is also from index.htm
<div id="pettabs" class="indentmenu">
<ul>
<li><a href="servicetab/onlinereport.jsp" rel="#iframe" class="selected">Online Law Report</a></li>
<li><a href="external2.htm" rel="#iframe">Moot Court</a></li>
<li><a href="external3.htm" rel="#iframe">Book Galleria</a></li>
<li><a href="external5.htm" rel="#iframe">Chambers Finder</a></li>

</ul>
<br style="clear: left" />
<!--<iframe style="background-color:transparent; visibility:hidden; white-spacere; overflow:hidden; position:absolute;"-->
</div>
<div id="petsdivcontainer" class="petsdivcontainer">

</div>

Assuming i have another page called index.htm with the following code;

<li style="list-style-image:url(images/icn/lpicn4.gif);"><span style="margin-left:8px"><a href="servicetab/external5.htm?sel=2">Find Chambers Near You</a></span></li>

I have tried this code, but it is opening in another page entirely instead of the specified tab.

drecute
08-01-2008, 03:48 PM
I got the solution. This is what i used;

since there is an instance of ddajaxtabs(), that is,
var mypets = new ddajaxtabs();

I then made a reference to the function in the ajaxtab.js. like this;

<a href="mypets.expandit(3)">something</a>
where 3 points to the 4th tab.

Thanks DD.