atomique
11-29-2007, 07:36 PM
1) Script Title: Tab Content Script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent2.htm
3) Describe problem:
I basically just want to change the text color of the selected tab. I tried changing this:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}
To this:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.color=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.color=document.getElementById("tabcontentcontainer").style.color=themecolor
}
And then called the color change using the "theme" command in the link, and it did different things in each browser. In Firefox, the link changed to the color I wanted, but wouldn't change back to the original color. In Safari, the link changed, but all of the other links turned white (the background color of the page, therefore making them invisible). In IE6, they changed, but instead of changing back to the original color, they turned black.
Here is the CSS I have:
#tablist{
padding: 0px;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: 12px Verdana;
color: #999999;
text-decoration:none;
}
#tablist li{
list-style: none;
display: inline;
margin: 0;
color: #999999;
text-decoration:none;
}
#tablist li a{
padding: 0px;
margin-left: 0px;
border: 0px;
border-bottom: none;
background: none;
padding-right:26px;
color: #999999;
text-decoration:none;
}
#tablist li a:link, #tablist li a:visited{
color: #999999;
}
.tablist li.selected a{
border-bottom-color: white;
color: #c1d72e;
}
#tablist li a.current{
background: none;
color: #999999;
}
#tabcontentcontainer{
width: 100%;
padding: 0px;
border: 0px;
}
.tabcontent{
display:none;
font: 12px Verdana;
color: #999999;
}
I tried using v2 of this script and couldn't get it working. This version is working much better, so it would be really great if I can get this straightened out.
Thanks for your help!
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent2.htm
3) Describe problem:
I basically just want to change the text color of the selected tab. I tried changing this:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}
To this:
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.color=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.color=document.getElementById("tabcontentcontainer").style.color=themecolor
}
And then called the color change using the "theme" command in the link, and it did different things in each browser. In Firefox, the link changed to the color I wanted, but wouldn't change back to the original color. In Safari, the link changed, but all of the other links turned white (the background color of the page, therefore making them invisible). In IE6, they changed, but instead of changing back to the original color, they turned black.
Here is the CSS I have:
#tablist{
padding: 0px;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: 12px Verdana;
color: #999999;
text-decoration:none;
}
#tablist li{
list-style: none;
display: inline;
margin: 0;
color: #999999;
text-decoration:none;
}
#tablist li a{
padding: 0px;
margin-left: 0px;
border: 0px;
border-bottom: none;
background: none;
padding-right:26px;
color: #999999;
text-decoration:none;
}
#tablist li a:link, #tablist li a:visited{
color: #999999;
}
.tablist li.selected a{
border-bottom-color: white;
color: #c1d72e;
}
#tablist li a.current{
background: none;
color: #999999;
}
#tabcontentcontainer{
width: 100%;
padding: 0px;
border: 0px;
}
.tabcontent{
display:none;
font: 12px Verdana;
color: #999999;
}
I tried using v2 of this script and couldn't get it working. This version is working much better, so it would be really great if I can get this straightened out.
Thanks for your help!