giggledesign
12-08-2003, 02:26 PM
I have a simple table with 5 cells that are to be used as buttons. When you hover on a cell I need that cell to highlight. Then when you hover over another cell, I need it to return to its normal color and highlight the selected cell. Any help would be greatly appreciated.
i did use a script but it only worked in Internet Explorer.
i need a script that will work in Mozilla. this was my old script:
CODE:
<script type="text/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
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
/CODE
does anyone have any ideas. help would be gratefully appreciated.
i did use a script but it only worked in Internet Explorer.
i need a script that will work in Mozilla. this was my old script:
CODE:
<script type="text/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
}
function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}
</script>
/CODE
does anyone have any ideas. help would be gratefully appreciated.