Jump to content

onmouseout


lilman

Recommended Posts

I have this code and it works when the mouse goes over but it doesn't work when the mouse moves off of it. The code is below, any help would be great!

 

 

<td bgcolor="#FF9900" valign="top" style="border: 2px solid #00003B" onmouseover="style.backgroundImage='url(hover-bg.jpg)'" onmouseout="style.backgroundColor='#00003B'">

Link to comment
https://forums.phpfreaks.com/topic/36786-onmouseout/
Share on other sites

Without knowing more than the info you supply, my best guess would be : because your background-image is on top of your background.

 

<td bgcolor="#FF9900" valign="top" style="border: 2px solid #00003B" onmouseover="style.backgroundImage='url(hover-bg.jpg)'" onmouseout="style.backgroundImage='none';style.backgroundColor='#00003B'">

 

btw you should use this.style for browser compatibility, and also end your inline javascript with semicolon, just like you usually would in js. Same in inline css.

 

<td bgcolor="#FF9900;" valign="top" style="border: 2px solid #00003B;" onmouseover="this.style.backgroundImage='url(hover-bg.jpg)';" onmouseout="this.style.backgroundImage='none';this.style.backgroundColor='#00003B';">

Link to comment
https://forums.phpfreaks.com/topic/36786-onmouseout/#findComment-177107
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.