Gimped
Oct 8th, 2002, 08:33 AM
I am trying to create a rollover effect that changes the BG colour of a cell in a table. I've kind of got it working, but not completely.
Here is the javaScript I have right now:
function change(color){
var el=event.srcElement
if (el.tagName=="TD")
event.srcElement.style.backgroundColor=color
}
I also have a stylesheet set up that sets the BG colour. What this code does is change the bg colour on a rollover of the cell, but it only works on the actual cell. So when you rollover the text that is linked, it doesn't work.
Please keep in mind that I am NOT an avid JS coder. I know very little, which is why I need help :)
Any ideas?
Here is the javaScript I have right now:
function change(color){
var el=event.srcElement
if (el.tagName=="TD")
event.srcElement.style.backgroundColor=color
}
I also have a stylesheet set up that sets the BG colour. What this code does is change the bg colour on a rollover of the cell, but it only works on the actual cell. So when you rollover the text that is linked, it doesn't work.
Please keep in mind that I am NOT an avid JS coder. I know very little, which is why I need help :)
Any ideas?