Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Handlers : onMouseOut, onMouseOver

Status
Not open for further replies.

manj

Programmer
Sep 22, 2000
28
GB
I have the following code:

<td onmouseout=&quot;bgColor=''&quot; onmouseover=&quot;bgColor='#ccffcc'&quot;><A HREF=&quot;test.htm&quot;>Cups & Mugs</A></td>

This works fine in IE but not in Netscape. Are these attributes supported by NN. If not is there a work-a-round solution.

Any help appreciated.
Cheers [sig][/sig]
 
Netscape 4.x doesn't support mousover events in anything but <A HREF=...> and FORM elements. You could try to move the onmouseover and onmousout events into your hyperlink, but then you will need to give your <TD> an ID in order for the event to know where to apply the background color. [sig][/sig]
 
Hi,
here is the code for your problem. It works fine in both IE and Netscape.

<TR>
<Script Language=&quot;JavaScript&quot;>
<!--
if (navigator.appName == &quot;Netscape&quot;) {
document.write('<TD><Layer OnMouseover=&quot;this.bgColor=\'#ccFFcc\'&quot; OnMouseout=&quot;this.bgColor=\'white\'&quot;><A Href=&quot;test.htm&quot;>Cups & Mugs</a></Layer></TD>');
} else {
document.write('<TD onmouseout=&quot;bgColor=\'\'&quot; onmouseover=&quot;bgColor=\'#ccffcc\'&quot;><A HREF=&quot;test.htm&quot;>Cups & Mugs</A></td>');
}
//-->
</Script>
</TR> [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top