JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 9th, 2004, 02:17 AM
medija's Avatar
medija medija is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: almere - netherlands
Posts: 2 medija User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via MSN to medija
Exclamation javascript and css problem

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

Reply With Quote
  #2  
Old April 9th, 2004, 03:21 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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 ).
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old April 9th, 2004, 04:34 AM
medija's Avatar
medija medija is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: almere - netherlands
Posts: 2 medija User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via MSN to medija
Exclamation

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!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > javascript and css problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT