Click to See Complete Forum and Search --> : Rollover Code
bzsim
07-30-2003, 07:54 PM
Hello. I'm using dreamweaver to build my site. I have a menu with three graphic images representing the links and I want to generate a code that does this:
when the user rolls their mouse over the menu graphic, I want a different graphic to change. I don't want the menu graphics themselves will to change, just an unrelated graphic. Is this possible?
Yes, it is possible. Something like this:
<a href="#" onmouseover="document.imagename.src='someother.gif';" onmouseout="document.imagename.src='theoriginal.gif';">Change image</a>
<img src="theoriginal.gif" name="imagename">
bzsim
07-30-2003, 10:18 PM
Thank you! That worked, except now my image does not restore to it's original when I move the cursor off of my menu choice. Can you help me do that too?!
That is this part of the code:
<a href="#" onmouseover="document.imagename.src='someother.gif';" onmouseout="document.imagename.src='theoriginal.gif';">Change image</a>
kdcgrohl
08-29-2003, 05:17 PM
Beware this method for your slower connected useres. Hide/Showing divs atop the pic works abit faster, for me anyway.