...

View Full Version : changing a links color in NS6



Yellow Jacket
07-03-2002, 04:27 PM
I am trying to get text links in a navigator frame to change to a different color than the colors defined in css until another link in the navigator is clicked. I got this to work in IE 6, but not NS 6. Here is my code:

link HTML
<A HREF="linkurl" TARGET="ContentFrame" onClick="setLinksColor();this.style.color='white'" >LinkTitle</A>

CSS:
A:LINK {
text-decoration : none;
font-style : normal;
color : black;
font : 8pt Arial;
}

A:VISITED {
text-decoration : none;
color : black;
font : 8pt arial;
}

A:HOVER {
text-decoration : none;
color : gray;
font : 8pt Arial;
}

A:ACTIVE {
text-decoration : none;
color : white;
font :normal 8pt Arial;
}

Javascript:
function setLinksColor() {
for (var i = 0; i < document.links.length; i++)
{
document.links[i].style.color="";

}
}

Can someone help? I hope this makes sense.

Thanks

Yellow Jacket

QuackHead
07-03-2002, 04:52 PM
why not just use straight CSS...

It should be working with just CSS, you shouldn't need a JS function

~Quack

Yellow Jacket
07-03-2002, 04:56 PM
it does not stay 'active' if something else is clicked.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum