我有一个线对象,我试图使用TimelineLite进行动画处理。由于时间轴函数中的第一个参数是元素,我该如何使用线对象?
function animatedLine(name, x1, y1, x2, y2, stroke, width, duration){
this.name = name;
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
this.stroke = stroke;
this.width = width;
this.duration = duration;
}
var line1 = new animatedLine("R01", 0, 0, 0, 100, "black", 3, 3);
基本上,该线的起点为x1,y1。或者,({"left": x1, "top": y1})
如何使线垂直制作动画,以使高度等于y2
的值,并且线条的宽度等于width
的值?