Change the image source on rollover using jQuery

前端 未结 14 1276
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 10:23

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 t

14条回答
  •  猫巷女王i
    2020-11-22 10:43

    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.

    
    

提交回复
热议问题