我想要将一系列图像显示为动画 - 我会使用GIF,但我想操作特定的帧。动态显示D3中的图像
我已将图像显示在SVG画布上,现在我想动态更改xlink:href
。
function startAnimation(){
c += 1;
d3.select(this)
.transition()
.attr("xlink:href", "images/image-" + c.toString() +".png")
.each("end", startAnimation);
};
这种方式工作得很好,如果我试图改变像图像高度的属性,但它似乎并没有与属性xlink:href
工作。
有没有办法像这样动态更新图像?
大 - 我觉得精灵表会为这项工作做得很好。谢谢! – Amyunimus