467,104 Members | 971 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 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.

http://www.personal.psu.edu/axg251/wc

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:

document.getElementById(id).style.color="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
  • viewed: 5451
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

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
By using this site, you agree to our Privacy Policy and Terms of Use.