2011-08-05 59 views

回答

9

您可以撥打第二個動畫後的第一個結束。

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/

4

使用回調animatehttp://jsfiddle.net/pPwRP/

什麼這會給你的是,第一個動畫結束後,將執行回調。


對於懶得點擊 - 這裏是代碼

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); 
    }); 
};