The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › remove an image and add a new image on mouse hover
I’ve an image in a div that just sites in that div. What I want to do is to remove this image on mouse hover and display a new image on the same mouse hover. How can achieve this?
Thanks a lot.
I would do it using jQuery, if you can have it available in your project… It would be something along the lines of:
Alternatively (and probably better depending on what you’re trying to achieve), you could use a <div> or <a> element with a background image, and use CSS sprites + jQuery to get those same results…
If this does not I would recommed using a sprite to accomplish this. There are articles all over this site. Check link below.
Best of luck.