Easiest way to HTML a hover over image

  • Thread starter Thread starter WeaponXxX
  • Start date Start date
  • Views Views 1,334
  • Replies Replies 3
CODE




Move the mouse over the image:




click here to test the code:
http://gbatemp.net/up/test.html

how does it work?
- two images ("reg.jpg" and "test.png") are loaded but hidden/invisible, with height=0 and width=0
- by default, test.png is displayed
- when the mouse moves over the image, test.png is replaced by reg.jpg
- when the mouse moves out of the image, test.png comes back
 
I was waiting for your post Costello
wink.gif



It's better than what I would have give him (something with function swap{})
It even manage the preload image with width/height=0.

I feel like an apprentice
shy.gif
 

Site & Scene News

Popular threads in this forum