用raphael制作动画路径 [英] animating paths with raphael

查看:88
本文介绍了用raphael制作动画路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍在努力弄清楚拉斐尔,并坚持使用一些基本动画。看看这里: http://jsfiddle.net/d7d3Z/

I'm still trying to figure out Raphael and am stuck with some basic animation. have a look here: http://jsfiddle.net/d7d3Z/

它足够简单:两条动画到位的路径。我想要的是它似乎像一条线一样画这个,而不是一起开始。

it's simple enough: two paths that animate into place. What I want though is for it to appear to 'draw' this like a single line, rather than both starting together.

如何订购动画?

推荐答案

你可以打电话第一个动画结束后的第二个动画。

You can call the second animation after the first one is over.

window.onload = function() {
    var c= Raphael("canvas", 200, 200);
    var p = c.path("M140 100");
    var r = c.path("M190 60");

    p.animate({path:"M140 100 L190 60"}, 2000, function() {
        r.animate({path:"M190 60 L 210 90"}, 2000);
    });


};

http: //jsfiddle.net/d7d3Z/1/

这篇关于用raphael制作动画路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆