lilman Posted February 2, 2007 Share Posted February 2, 2007 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 More sharing options...
janroald Posted February 4, 2007 Share Posted February 4, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.