472,352 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

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
0 5594

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" />...
2
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. ...
5
by: JezB | last post by:
Is it possible to programatically examine and modify a page's Styles (including Cascading Style Sheets) within the code-behind-module (eg. c#) ? ...
3
by: Irfan Akram | last post by:
Hi Guys, Where do we specify style sheets link, so that it is used through the asp.net web-application? Will wait for a useful response, ...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy...
1
by: printline | last post by:
Hello All I'm a newbee to javascript/ajax. I have produced a form, where i want to do some validation on some fields. I have used the spry...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.