View Full Version : "selected" class not working

03-27-2008, 06:49 PM
1) Script Title: Tab Content Script (v 2.1)

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

3) Describe problem: Script is working very well, except the link that is designated with the "selected" class is not being used as default when the page loads. Instead the 1st tab always shows.

URL to my site: Quarterlives (http://www.quarterlives.com/) (It's the section with "WTF," "10," and "WWW")

Code for the links:

<div class="tabbuttons">
<div id="countrytabs">
<a id="wtf" href="#" rel="country1">&nbsp;</a>
<a id="topten" href="#" rel="country2" class="selected">&nbsp;</a>
<a id="www" href="#" rel="country3">&nbsp;</a>
I have tried adding "linkparent" to "countries.setselectedClassTarget" in the code just under the tab content containers - then adding divs around the tab links, with one having the "selected" class. It did not work. Is there anything I'm missing, and how can I get the "selected" functionality to work?

03-27-2008, 07:59 PM
Hmmm at a glance everything checks out OK as far as your installation of the script. I see the problem you're describing. There are a few JavaScript errors thrown from some of the other scripts on your page not related to Tab Content script, such as:

Error: this.$events[type].keys has no properties
Source File: http://www.quarterlives.com/wp-content/plugins/content-gallery/scripts/mootools.v1.11.js
Line: 3

My guess is when the browser encountered those errors, it halts/ disrupts the execution of Tab Content script as well. To confirm this, create a page stripped of all other scripts except Tab Content script, and see if that fixes the problem. Then slowly add back the other scripts to see which one is at fault.