CSS Styles with Javascript Table Rollover
by "David R. Longnecker" <davidl(at)activematrixsolutions.com>
|
Date: |
Wed, 23 May 2001 22:51:14 -0500 |
To: |
"Hwg-Techniques" <hwg-techniques(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
Hey everyone.. I'm attempting to modify a script that a fellow designer
sent to me. The purpose of the script is to highlight and add a
rollover effect using CSS styles and javascript. I'm trying to modify
it to spice it up a bit with a bold and colour change so that the text
is more readable _without_ applying it in styles, but in the javascript.
My problem is that I cannot figure out the proper DOM to activate the
font colour change. I've been able to bold it, but not change it's
colour. Below is a section of the Javascript.
function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
source.style.fontweight="bold"
// source.style.color="white" How to change this to
white?
}
Any ideas would be great! You can preview the page and code at
http://activematrixsolutions.com/preview-hwg.htm
TIA!!
-David
President & CEO
ActiveMatrix Solutions
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA