trichins
10-18-2005, 08:37 PM
Script: Tab Content Script
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
For the most part, the Tab Content Script works very well, except for identifying the current tab.
The style sheet has the following rule:
#tablist li a.current{
background: lightyellow;
}
...and the HTML code has the following:
<ul id="tablist">
<li><a href="http://www.dynamicdrive.com" class="current" onClick="return expandcontent('sc1', this)">Dynamic Drive</a></li>
<li><a href="new.htm" onClick="return expandcontent('sc2', this)" theme="#EAEAFF">What's New</a></li>
It appears that the class="current" is hardcoded and not dynamically asigned by the script. Is that intentional? So the first tab (id=sc1) is always assigned the "current" class identifer?
I would like to be able to style the current or active tab, but am not able to with the code as it is. I would like to know if this is an oversight or intentional. If it's an oversight, any idea how to fix it?
Thank you!
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
For the most part, the Tab Content Script works very well, except for identifying the current tab.
The style sheet has the following rule:
#tablist li a.current{
background: lightyellow;
}
...and the HTML code has the following:
<ul id="tablist">
<li><a href="http://www.dynamicdrive.com" class="current" onClick="return expandcontent('sc1', this)">Dynamic Drive</a></li>
<li><a href="new.htm" onClick="return expandcontent('sc2', this)" theme="#EAEAFF">What's New</a></li>
It appears that the class="current" is hardcoded and not dynamically asigned by the script. Is that intentional? So the first tab (id=sc1) is always assigned the "current" class identifer?
I would like to be able to style the current or active tab, but am not able to with the code as it is. I would like to know if this is an oversight or intentional. If it's an oversight, any idea how to fix it?
Thank you!