PDA

View Full Version : Ajax Tabs Content - "selected" class applied incorrectly



Gozlingo
09-08-2008, 01:19 PM
1) Script Title:
Ajax Tabs Content Script (v 2.2)

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

3) Describe problem:

Hi,

I've set up this script and got it working perfectly except for one small problem. When I click on a tab which isn't the default tab all the tab's classes are set to "selected" (apart from the default tab).

This means that all the tabs apart from the default appear in their selected state. Only the tab I clicked on should be give class="selected".

Here is my code:




<div id="primary_box_content">

// Default Content Here

</div><!-- primary_box_content -->

<ul class="primary_tabs" id="primaryTabs">
<li><a id="tab1" class="selected" rel="#default" href="#">News</a></li>
<li><a id="tab2" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">Features</a></li>
<li><a id="tab3" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">City Guides</a></li>
<li><a id="tab4" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">Places</a></li>
</ul>

<script type="text/javascript">
var primary=new ddajaxtabs("primaryTabs", "primary_box_content");
primary.setpersist(true);
primary.setselectedClassTarget("link");
primary.init(5000);
</script>





So when I click one of the links, either Features, City Guides or Places, this is what I get:



<ul class="primary_tabs" id="primaryTabs">
<li><a id="tab1" class="" rel="#default" href="#">News</a></li>
<li><a class="selected" id="tab2" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">Features</a></li>
<li><a class="selected" id="tab3" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">City Guides</a></li>
<li><a class="selected" id="tab4" rel="primary_box_content" href="/wp-content/themes/embrace/template_elements/cityguide_ajax.php">Places</a></li>
</ul>


Where are all three anchors in the selected state :confused: ??

Thanks,
Oli

ddadmin
09-08-2008, 11:39 PM
Hmmm I see no reason why this would happen. Please post a link to the page on your site that contains the problematic script so we can check it out.