hey guys, having some probs here for some weird reason my Javascript code isn't working how it should.
The idea is you can move the mouse over the table row and it will highlight the current row, now that works fine but I also want it so that if you click the row then it will change it to a darker colour which also works, now here is the trublesome part, when you moe the mouse away from this row then it should stay the same colour!
this is what I came up with
Code:
if ($bgcolor == '#FFFFFF')$bgcolor = '#F3F3F3';
else $bgcolor = '#FFFFFF';
?>
<tr bgcolor="<?=$bgcolor;?>" onmouseover="if (this.bgColor = '<?=$bgcolor;?>'){this.bgColor = '#DDDDDD'} else {this.bgColor = '#CCCCCC';}" onmouseout="if (this.bgColor = '#DDDDDD'){this.bgColor = '<?=$bgcolor;?>'} else {this.bgColor = '#CCCCCC';}" onclick="this.bgColor = '#CCCCCC';">
but when you move the mouse out of the row that has been clicked on it resets the colour to the value of $bgcolor  anyone have any ideas?
btw tried to put the onmouseover and that lot into a function but then it didn't work at all which i found totally weird
|