PDA

View Full Version : Mousout !!


wap3
09-11-2002, 01:13 PM
Hi everyone,

I am not sure if this is in the right place, so please move it if necessary.
Anyway the problem I have is this:
I am using this line of code to change the background of a table cell on mouseover and mouseout. On mouseout I want the table cell to have no background color at all, ie. transparent.
The following works in explorer but not netscape. How can I do this so it works in both ??

onMouseover=this.style.background="#99CCFF" onMouseout=this.style.background=""

Thanks :thumbsup:

mbenson
09-11-2002, 02:08 PM
I'm pretty sure that NN doesn't support it (before 6.2). The best thing you can do, in my opinion, is to make it look as neet as possible in all browsers. I got this, and it looks alright accross, but looks the best in IE. At least the links work in the cells. Try it out just to see.

<table width="145" cellpadding="1" cellspacing="0" border="1" bordercolor="#ffffff" bordercolorlight="#000000">

<caption>User Navigation</caption>
<tr>
<td class="nav" bgcolor="#E7E5D3" onclick="javascript:document.location.href='http://www.yahoo.com'" onmouseover="this.style.background='#ECECE6'" onmouseout="this.style.background='#E7E5D3'" style="cursor: pointer">

<a class="nav" href="http://www.yahoo.com">Yahoo</a>
</td>
</tr>

<tr>
<td class="nav" bgcolor="#E7E5D3" onclick="javascript:document.location.href='http://www.yahoo.com'" onmouseover="this.style.background='#ECECE6'" onmouseout="this.style.background='#E7E5D3'" style="cursor: pointer">

<a class="nav" href="http://www.yahoo.com">Yahoo</a>
</td>
</tr>

<tr>
<td class="nav" bgcolor="#E7E5D3" onclick="javascript:document.location.href='http://www.yahoo.com'" onmouseover="this.style.background='#ECECE6'" onmouseout="this.style.background='#E7E5D3'" style="cursor: pointer">

<a class="nav" href="http://www.yahoo.com">Yahoo</a>
</td>
</tr>

</table>

wap3
09-11-2002, 03:01 PM
Thanks mbenson

I figured it out in the meantime. I put 'backgroundColor' instead of 'backgound'.

That works fine, in I.E 5.5 and Netscape 6.2

:thumbsup: