<script type="text/javascript">
function cellbg(cellid,cellcolour)
{
// accept single cell id and colour, or comma seperated list of cell ids
and cell colours
// check to see if number of cells and number of colours match, if not exit
the function
var CellList=cellid.split(',');
var ColList=cellcolour.split(',');
if(CellList.length!=ColList.length || CellList.length==0 ||
ColList.length==0) return false;
// actually change the cell colour
for(n=0;n<CellList.length;n++)
{
document.getElementById(CellList[n]).style.backgroundColor=ColList[n];
}
}
</script>
and in your table
<tr>
<td id="a1" onMouseOver="cellbg('a1','#eeeeee');"
onMouseOut="cellbg('a1','#ffffff');">a1</td>
<td id="a2" onMouseOver="cellbg('a2','#eeeeee');"
onMouseOut="cellbg('a2','#ffffff');">a2</td>
<td><a href="#" onMouseOver="cellbg('a1,a2','#00ff00,#00ff00');"
onMouseOut="cellbg('a1,a2','#ffffff',#ffffff);" onClick="return
false;">row</a></td>
</tr>
the function can handle single or multiple cells and has been tested with IE
6 and Netscape 7
NeoPhreak said:
Any chance someone could please help me out by starting me off... I'd really
appreciate it!
thnx