jQuery - Change image src on hover

前端 未结 6 966
自闭症患者
自闭症患者 2020-12-10 14:28

Basically I want to change the image src to add -active.png on hover.

So fb.png would become fb-active.png on hover, and fb.png when it\'s not hovering.

6条回答
  •  独厮守ぢ
    2020-12-10 15:06

    You can add an extra attribute to your image, like "alt_img" and then just wait for the hover event and switch the attributes. Its a very simple approach.

    
    

提交回复
热议问题