How to update the source of an Image

前端 未结 3 1893
渐次进展
渐次进展 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:04

    var paper = Raphael("placeholder", 800, 600);
    var c = paper.image("apple.png", 100, 100, 600, 400);
    c.node.href.baseVal = "cherry.png"
    

    I hope, you get the idea.

提交回复
热议问题