Click to See Complete Forum and Search --> : Changing Image in second Cell on Mouseover


andersoni
07-20-2003, 07:24 PM
I am looking for a way to change a image in a second cell when I mouse over the first cell.

Do I need to use an ID in the second cell? Can I use an ID with the <img> tag instead?


Thanks,

Ian

pyro
07-20-2003, 07:30 PM
Actually, images can be referenced with the images array, or by name. For example, you can reference:

<img src="yourimg.png" name="myimg">

like this:

document.myimg

andersoni
07-20-2003, 07:38 PM
So...

Something like this,

onmouseover="document.myimg='second.gif'"

or
onmouseover="document.myimg.src='second.gif'"

Ian

pyro
07-20-2003, 07:41 PM
Yeah, use the "or" one... ;)

andersoni
07-20-2003, 07:44 PM
Perfect!!

Thanks

pyro
07-20-2003, 07:45 PM
You're welcome... :)