开发者

Raphael JS, Path animation

开发者 https://www.devze.com 2023-02-23 07:56 出处:网络
I have a path: var original_param = \'M \'+p1.x+\' \'+p1.y+\'L \'+p2.x+\' \'+p2.y; var pa开发者_开发知识库th = paper.path(original_param);

I have a path:

var original_param = 'M '+p1.x+' '+p1.y+'L '+p2.x+' '+p2.y;
var pa开发者_开发知识库th = paper.path(original_param);

I have defined another path attribute for animation:

var animation_param={M: p11.x+' '+p11.y, L: p22.x+' '+p22.y}

where p1 and p2 are points, I do not put their definitions here, since they return the proper values correctly here.

Then I animate the path with the parameters by:

path.animate(animation_param, 1000);

But I got error message

Raphael JS, Path animation

What is the reason of this error?


Did you try use animation_param as string except object? I think it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消