cell image roll over problem in Netscape

liunx

Guest
hi all!<br />
I was trying to make a cell that has a background image, when you mouse over that cell, the cell background changes into another picture, and change back when you mouse out!<br />
Here is what I have so far<br />
<br />
<html><br />
<head><br />
<title>Test</title><br />
</head><br />
<body><br />
<table><br />
<tr><br />
<td background="swap_out.gif" width="125" onmouseover="background='swap_over.gif'" onmouseout="background='swap_out.gif'">&nbsp;&nbsp; Text 1</td><br />
</tr><br />
</table><br />
</body><br />
</html><br />
<br />
the problem is that when I mouse over the cell in IE, it works fine, but when I test that in Netscape, the cell background image doesn't change, BUT the whole page background changes!<br />
<br />
I suspect that Netscape interprets every "background" as to the page background, but if I want to achieve what I want, what should I do<br />
<br />
I attach a file in case you need reference<br />
please help, thanks!:D<!--content-->how about something like this:<br />
<br />
<br />
<br />
<style type="text/css"> <br />
td.image { <br />
background: url(foo.gif); <br />
} <br />
<br />
td.image2 { <br />
background: url(foo2.gif); <br />
} <br />
</style> <br />
<script type="text/javascript"> <br />
function rollover(obj, item){ <br />
obj.className = item; <br />
} <br />
</script> <br />
</head> <br />
<br />
<body> <br />
<table> <br />
<tr> <br />
<td class="image" onmouseover="rollover(this,'image2');" onmouseout="rollover(this,'image')">text</td> <br />
<td class="image" onmouseover="rollover(this,'image2');" onmouseout="rollover(this,'image')">text</td> <br />
</tr> <br />
</table> <br />
</body> <br />
</html><!--content-->hi leon24<br />
great thanks to you! your code works like a charm, it solves my problems!<br />
thanks again!:D<!--content-->you're welcome :)<!--content-->
 
Back
Top