I have a few images and their rollover images. Using jQuery, I want to show/hide the rollover image when the onmousemove/onmouseout event happen. All my image names follow the same pattern, like this:
Original Image:
Image.gif
Rollover Image:
Imageover.gif
I want to insert and remove the "over" portion of image source in the onmouseover and onmouseout event, respectively.
How can I do it using jQuery?
Whilst looking for a solution some time back, I found a similar script to the below, which after some tweaking I got working for me.
It handles two images, that almost always default to "off", where the mouse is off the image (image-example_off.jpg), and the occasional "on", where for the times the mouse is hovered, the required alternative image (image-example_on.jpg) is displayed.