PDA

View Full Version : 2 Ajax Tabs Contents on the same page (one inside of another)



viens
03-13-2007, 06:47 PM
1) Script Title: Ajax Tabs Contents

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

3) Describe problem: I spent the whole day trying to customize this script so that if I click on some tab, it loads another tabs content with sub-tabs.

Maybe it's hard to understand what I mean, so I post 1 of my tests below. Screenshoot attached.

============
demo.htm



<body>

<ul id="maintab" class="shadetabs">
<li><a href="external.htm" rel="ajaxcontentarea">Europe</a></li>
<li><a href="external2.htm" rel="ajaxcontentarea">Asia</a></li>

</ul>

<div id="ajaxcontentarea" class="contentstyle">

Default Content

</div>



<script type="text/javascript">
startajaxtabs("maintab", "newstab")
</script>


</body>

external.htm



<ul id="newstab" class="shadetabs">
<li><a href="external.htm" rel="newscontentarea">Germany</a></li>
<li><a href="external2.htm" rel="newscontentarea">Spain</a></li>

</ul>

<div id="newscontentarea" class="contentstyle">
Europe main content
</div>


external2.htm




<ul id="newstab" class="shadetabs">
<li><a href="external.htm" rel="newscontentarea">Indonesia</a></li>
<li><a href="external2.htm" rel="newscontentarea">Malasya</a></li>

</ul>

<div id="newscontentarea" class="contentstyle">
Asia main content
</div>


Everything works fine, except sub-tabs. The content of sub-tabs opens not inside of div, but as a new file.

Thanks in advance.

DigitalReaperX
04-17-2007, 06:23 PM
I'm having the same issue. Can anyone help out.? I have tried several methods of renaming variables. But the secondary tabs never open in the div.. they load into the entire window or a new window. Any help would be appreciated.

shyne
04-18-2007, 08:32 PM
Me tooo pleasee help someonee

Peter2007
07-19-2007, 09:44 PM
I also have this problem :-(

comprax
07-20-2007, 08:49 PM
same problem here...
would be nice if someone could help out to find a solution for this :D

zorag
09-12-2007, 01:59 PM
Ajax Tabs is not capable of opening multiple pages within the same tab, you would need to create a blank HTML page with an iFrame, then call the HTML page for the tab.

ddadmin
09-12-2007, 11:32 PM
Actually, nesting sub tabs within an external page that also fetch its content via Ajax is possible. You just need to know that startajaxtabs() needs to be called separately for the sub tabs, specifically, after they've been added to the DIV on your page.

Attached is a demo of how this works. Only two files changed are ajaxtabs.js, and demo.htm (with a new subtabid attribute).