1
test(0);
function test(Num){
if (Num<6){
ball.attr({ cy:520 , cx:900});
ball.animate({cy: 520 , cx: 400}, speed, test(Num+1));
}else{
//something
}
}
我已經使用Raphael Javascript框架編寫了此代碼,但無法將其傳遞給回調函數。特別是測試(Num + 1),我如何將參數傳遞回來,以便函數重複x次,就像它剛剛運行一次並停止一樣。Raphael.js - 在動畫之後運行函數,同時傳遞參數
完美無瑕地工作,謝謝。 – JJC