捕捉SVG序列动画,无需等待动画完成

时间:2016-05-12 22:42:35

标签: animation svg delay snap.svg

我想用快照对svg动画进行排序,但我不想在开始下一个动画之前等待一个动画完成。有没有办法做到这一点?

到目前为止,我有:

    var DrawmusicRoute = function () {
    musicRouteLine1.stop();
    musicRouteLine1.attr('display', '');
        musicRouteLine1.attr({
            fill: 'none',
            stroke: '#3EB799',
            strokeWidth: 17,
            strokeDasharray: musicRouteLine1_len + ' ' + musicRouteLine1_len,
            strokeDashoffset: musicRouteLine1_len,
        }).animate({
            strokeDashoffset: 0
        }, 1500, function () {
setTimeout(DrawmusicRoute2(), 3000)}
        );
    };

var DrawmusicRoute2 = function () {
     musicRouteLine2.stop();       
        musicRouteLine2.attr('display', '');
        musicRouteLine2.attr({
            fill: 'none',
            stroke: '#3EB799',
            strokeWidth: 17,
            strokeDasharray: musicRouteLine2_len + ' ' + musicRouteLine2_len,
            strokeDashoffset: musicRouteLine2_len,
        }).animate({
            strokeDashoffset: 0
        }, 500);
    };

0 个答案:

没有答案