2014-01-07 147 views
0

我正在開發一個項目,該項目需要我同時對單個對象進行動畫處理2-3次,而無需對它們進行排隊。動畫運行如下:立即完成動畫 - jQuery

jQuery("#Object").animate({'left': '0px', 'top':'0px'},{duration:0,queue:false}); 
jQuery("#Object").animate({'left':xPosition,'top':yPosition},{duration:Time, queue: false}); 

我已經特林弄清楚如何獲得第二位置的動畫停止中等執行和重置回點(0,0)。由於對象是spritesheet,我也在運行:

jQuery("#Object").animate({'background-image-x':'0px'},{duration:0,queue:false}); 
jQuery("#Object").animate({'background-image-x':nextFrame},{duration:0,queue:false}); 
// ^this second one is to be set to an interval of some kind, or run in a loopback anim function 

同樣,我試圖讓動畫重置並再次播放。

謝謝你的幫助。

+0

爲什麼使用動畫()的持續時間等於0? –

回答