|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
can you help me out?!?
I was also working with the A.nav:link stuff but I have a small problem.. look this is my script <html> <head><style type="text/css"> #box1{ color: "#868686"; } A.nav:link{ color: "#868686"; } A.nav:visited{ color: "#868686"; } </style> <script language="JavaScript"> function change(){ document.getElementById("box1").style.color = "#868686"; document.getElementById("box1").nav.color = "#ffffff"; } function change() should change the color of the text AND the link color. but as you can see the last part is a mass. I really dont know how to write it down the way it has to be. does anyone know? thanx anyway |
|
#2
|
||||
|
||||
|
You don't need Javascript to control the appearance of links - this can all be done in CSS. Simply use the correct CSS pseudo class on the "a" rule (currently IE does not allow hover pseduo classes on anything other than "a"'s - very annoying.)
So, to control the appearance of normal links, the rule would be: a { color : blue;} To change the hover colour: a:hover { color : green; } If the item you want to change is not an "a", use: document.getElementById("IDNAME").style.color='green' All CSS properties are controlled in JS using the "style" DOM node property (for lack of the correct term ). |
|
#3
|
||||
|
||||
|
you dont understand. I DO need jscript to change it
reason= I changed everything with jscript and I want this to change too, along with the rest. so my question is how to change it. I know that it changes when I put A.nav:link{ color: "#868686";} in the style placed in the head. but I made different styles witch changes the backcolor, the images, the td backgrounds and the color of the text. BUT the links color has to change too. if you would like to see the script yourself, check it at http://www.medija.nl/new_page/ please tell me! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > javascript and css problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|