2013-08-24 71 views
-3

的jQuery:jQueryRotate插件設置延遲

$("#image").rotate({ 
    angle: 0, 
    center: ["50%", "100%"], 
    duration: 5000, 
    animateTo: 15 
}); 

我想延遲設置爲這個。

+0

可否請你澄清你的意思是「我要延遲設置爲這個」?你是說在一段時間之後你想要這樣嗎? –

+0

我把這個代碼放在#image2,#image3中,所以我想要一個接一個地動畫 – AkilaH

回答

0

根據你的評論,這聽起來像你需要的是使用回調,動畫結束時調用rotate()。據the documentation你可以傳遞一個callback參數是這樣的:

$("#image").rotate({ 
    angle: 0, 
    center: ["50%", "100%"], 
    duration: 5000, 
    animateTo: 15, 
    callback: function() { 
     $("#image2").rotate({ 
      angle: 0, 
      center: ["50%", "100%"], 
      duration: 5000, 
      animateTo: 15 
     }); 
    } 
}); 

可以傳遞另一個回調到#圖像2#爲等圖像3