Snippet Name: Highlight table rows on rollover
Description: Easy way to make table rows change color (highlight) when the cursor is moved over them.
Comment: (none)
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: February 27th, 2009
|
<script type="text/javascript">
FUNCTION hiLiteRows(){
VAR x = document.getElementsByTagName('tr');
FOR (VAR i=0;i<x.length;i++)
{
x[i].onmouseover = FUNCTION () {THIS.origColor=THIS.style.backgroundColor;
THIS.style.backgroundColor='#D8E5F2';
}
x[i].onmouseout = FUNCTION () {THIS.style.backgroundColor=THIS.origColor;}
}
}
window.ONLOAD=hiLiteRows;
</script> |