469,903 Members | 2,004 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

using style sheets and javascript to change link color based on what's selected in frames

Hi everyone. I'm working on a navigation menu (in a frameset) that I
want to set the "active" link to black (the link that corresponds to
the page displayed in the right side of the frame) to black.


In the original external style sheet, I set the a:link, a:visited,
a:active, and a:hover. That works fine.

In the navigation page, I call a function for onclick - it sets the
link just clicked to black:


AND sets the link that was black back to the original color:

document.getElementById(oldclass).style.color="#39 4B8E";

The problem is then I lose the "hover" feature. I've tried instead of
setting the "color" in the function actually setting "a:link.color",
"a:visited.color", etc. (for link, visited, active, and hover) but it
doesn't work AND I read in this ng that you can't use a javascript
function to change a pseudo class. Is that true?

Here's the site: http://www.personal.psu.edu/axg251/wc

Note that the "hover" works until you've clicked on the link - then
it no longer works.

Any ideas are appreciated. I'm happy to post all the code here - I
thought it would be easier for you to just look from the site - if
not, just let me know.

Thanks for your help!
Andrea :-)

p.s. It's a test site - I *know* it's ugly! ;-)
Jul 20 '05 #1
0 5515

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by DettCom | last post: by
5 posts views Thread by JezB | last post: by
3 posts views Thread by Irfan Akram | last post: by
12 posts views Thread by Jarno Suni | last post: by
9 posts views Thread by Radium | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.