TheDennis
04-23-2010, 02:57 AM
Ajax Tabs Content Script
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/
Hi
I followed you tutorial for the ajax tabs and it's working fine. But i'm trying to have a secondary set of tabs to replace to first set of tabs. But i can only get one two work at a time - the secondary tabs replace the first ones, but when you click the new tabs to view their content it just opens up in a new page, instead of loading it into the content box. I tried renaming the countries variable but that didn't seem to help...
Heres my code:
<div id="contentdivcontainer">
<div id="contentdivcontainer2"><img src="images/photos/photo16.jpg"></div>
<div id="contenttabs2">
<a href="#" rel="#default" class="selected"><img src="images/photos/thumbs/thumb_blue.jpg"></a>
<a href="photography/photo15.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_pipes.jpg"></a>
<a href="photography/photo14.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_girl.jpg"></a>
<a href="photography/photo13.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_roof.jpg"></a>
<a href="photography/photo12.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_chairs.jpg"></a>
<a href="photography/photo11.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_jars.jpg"></a>
<a href="photography/photo10.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_wood.jpg"></a>
<a href="photography/photo9.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_boxing.jpg"></a>
<a href="photography/photo8.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_paint.jpg"></a>
</div>
<div id="contenttabs3">
<center><a href="#" rel="#default" class="selected">Page1</a>
<a href="photography/morelinks.html" rel="contentcontainer">Page2</a></center>
</div>
</div>
</div>
<script type="text/javascript">
var countries=new ddajaxtabs("contenttabs2", "contentdivcontainer2")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
<script type="text/javascript">
var countries=new ddajaxtabs("contenttabs3", "contenttabs2")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/
Hi
I followed you tutorial for the ajax tabs and it's working fine. But i'm trying to have a secondary set of tabs to replace to first set of tabs. But i can only get one two work at a time - the secondary tabs replace the first ones, but when you click the new tabs to view their content it just opens up in a new page, instead of loading it into the content box. I tried renaming the countries variable but that didn't seem to help...
Heres my code:
<div id="contentdivcontainer">
<div id="contentdivcontainer2"><img src="images/photos/photo16.jpg"></div>
<div id="contenttabs2">
<a href="#" rel="#default" class="selected"><img src="images/photos/thumbs/thumb_blue.jpg"></a>
<a href="photography/photo15.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_pipes.jpg"></a>
<a href="photography/photo14.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_girl.jpg"></a>
<a href="photography/photo13.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_roof.jpg"></a>
<a href="photography/photo12.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_chairs.jpg"></a>
<a href="photography/photo11.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_jars.jpg"></a>
<a href="photography/photo10.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_wood.jpg"></a>
<a href="photography/photo9.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_boxing.jpg"></a>
<a href="photography/photo8.html" rel="contentcontainer"><img src="images/photos/thumbs/thumb_paint.jpg"></a>
</div>
<div id="contenttabs3">
<center><a href="#" rel="#default" class="selected">Page1</a>
<a href="photography/morelinks.html" rel="contentcontainer">Page2</a></center>
</div>
</div>
</div>
<script type="text/javascript">
var countries=new ddajaxtabs("contenttabs2", "contentdivcontainer2")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
<script type="text/javascript">
var countries=new ddajaxtabs("contenttabs3", "contenttabs2")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>