【发布时间】:2011-03-09 13:15:46
【问题描述】:
我正在使用 Raphael 库来创建 SVG 对象。
为了初始化 SVG 形状并为里面的所有东西创建一个画布,我使用了文档中所述的以下行:
var paper = Raphael(10, 50, 320, 200);
我现在想要为纸张和其中的所有内容制作动画,就像我要为已按以下方式附加到纸张的形状制作动画一样:
var firstShape = paper.rect(x, y, width, height);
firstShape.animate({x: 100}, 500, "<");
当我尝试与论文类似的事情时,例如:
paper.animate({x: 100}, 500, "<");
我收到错误“paper.animate is not a function”。
这里发生了什么,我该如何解决?
【问题讨论】:
标签: javascript html svg raphael