473,569 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getEle mentById(id).st yle.color="blac k";

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

document.getEle mentById(oldcla ss).style.color ="#394B8E";

The problem is then I lose the "hover" feature. I've tried instead of
setting the "color" in the function actually setting "a:link.col or",
"a:visited.colo r", 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 5665

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

Similar topics

10
13426
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 a posting a just made here in the same group related to checkboxes. Thanks!!!
12
3080
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" /> <style type="text/css"> DIV.Application { BACKGROUND-IMAGE:url(/someImage.jpg); }
2
3729
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. I did get it working with one small problem that I can't figure out. For the sake of being really simple here are the steps i took. 1. create blank web page, create blank css page. 2. save 'em...
5
1674
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#) ? My guess is that since these are HTML elements the answer is no, since these will only exist in the browser whereas the code-behind runs on the web server, but I wanted verification from you experts...
3
996
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, Thanks, I.A..
12
2054
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 handheld and screen. Is it possible without writing all styles specified for screen again for handheld? -- Homepage http://www.iki.fi/jarno.suni/
9
2016
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 images on your monitor to their computers. It also allows them to copy files from your computer to their's. It is dangerous. Avoid at all costs. CSS that isn't stored in the victim's computer....
1
2224
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 framework and it works fine. Now, i have a select list, where if i choose a certian option, more fields in the form will appear. My problem is only to validate on these fields if they are visible. I...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.