How to update the source of an Image

前端 未结 3 1891
渐次进展
渐次进展 2021-01-01 06:54

I\'m using the Raphaël Javascript lib (awesome stuff for SVG rendering, by the way) and am currently trying to update the source of an image as the mouse goes over it.

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 07:13

    This works for me (and across all browsers):

    targetImg.attr({src: "http://newlocation/image.png"})
    

提交回复
热议问题