On Jul 16, 3:20 pm, David Mark <dmark.cins...@gmail.com> wrote:
> On Jul 16, 2:43 pm, vunet...@gmail.com wrote:
>
> > To highlight the table's row with onmouseover/onmouseout events I use
> > 2 functions which switch rows' class names. How can I highlight the
> > same rows, if every cell of the row contains various class names?
>
> > If cell has a CSS class name with some BG color, row's BG color is no
> > longer visible. I tried a function to loop through every cell of the
> > row and remove className onmouseover and apply back onmouseout. But
> > that generates error that className property is not found, even though
> > it is there. There are a lot of problems like that when I googled for
> > "error getting className property".
>
> Can't help you there as you didn't post any code. But, if all of your
> cell's have different colors, then perhaps you shouldn't obscure this
> distinction in your rollover effect.
copy-paste code demonstrates the problem: only last row is
highllighted...
<html><head>
<title>Simple example</title>
<style type="text/css">
..blue{background-color:lightblue;}
..red{background-color

range;}
..yellow{background-color:lightyellow;}
..tableRowOver{background-color:gold;}
..tableRrow{}
</style>
<script language="JavaScript">
function start(){
var d = document.getElementById("myDiv");
d.innerHTML = "<table width='100%'><tr onmouseover='hilite(this)' "+
"onmouseout='lolite(this)'><td class='blue'>blue</td>"+
"<td class='red'>red</td><td class='yellow'>yellow</td></tr>"+
"<tr onmouseover='hilite(this)' onmouseout='lolite(this)'>"+
"<td class='blue'>blue</td>"+
"<td class='red'>red</td><td class='yellow'>yellow</td></tr>"+
"<tr onmouseover='hilite(this)'onmouseout='lolite(this) '><td
class='blue'>blue</td>"+
"<td class='red'>red</td><td class='yellow'>yellow</td></tr>"+
"<tr onmouseover='hilite(this)'onmouseout='lolite(this) '><td>empty</
td>"+
"<td>empty</td><td>empty</td></tr></table>";
}
function hilite(row){row.className = 'tableRowOver';}
function lolite(row){row.className = 'tableRow';}
</script>
</head>
<body ONLOAD="start()">
<div id='myDiv'></div>
</body>
</html>