Might anyone know WHY this script works in Firebird/Opera but does not work in IE based browsers...?
If you need an explination, it's for changing the colors of table rows when moused over..based on two CSS classes (over and norm..) which change the look of the row. Basically, what doesn't work is the click function..the over works perfect. I think it might have something to do with the array.
Code:
var marked = new Array();
function over(obj, state) {
if ( state == 'on' && marked[obj] != true ) {
document.getElementById(obj).className = 'over';
} else if ( marked[obj] != true ) {
document.getElementById(obj).className = 'norm';
}
}
function click(obj) {
if ( marked[obj] != true ) {
marked[obj] = true;
document.getElementById(obj).className = 'over';
} else {
marked[obj] = false;
document.getElementById(obj).className = 'norm';
}
}
Here is an example of how it could be implemented:
Code:
<tr class="norm" id="4" onMouseOver="over('4', 'on')" onMouseOut="over('4','off')" onclick="click('4')">