View Full Version : Change DIV BG Image On Hover
05-20-2005, 05:45 PM
I'm having trouble changing a DIV background image when it is hovered over - is there an easy way?!
05-20-2005, 06:27 PM
background: #hex123 url(back.gif);
05-20-2005, 08:32 PM
<div onmouseover="this.style.background='url(yourimage.jpg)';" omouseout="this.style.background='url(youroriginalimg.jpg)';"></div>
EDIT: Sorry I forgot the single quotes, that is why it wasn't working.
05-20-2005, 10:10 PM
Thanks, but why am I getting an error with -
<div id="startbutton" onmouseover="this.style.background=url(Start_Hover.JPG);" onmouseout="this.style.background=url(Start_Off.JPG);">
EDIT: No worries - working now!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.