为什么绿色和黄色块在这里循环:
但尚未在这里:
var trackMaster = new TimelineLite({ paused: false, repeat: -1 });
function addParticle(particleClass){
$('#display').append("<div class='" + particleClass + "' style='color: black'></div>");
}
for(i = 0; i < 300; i++){
var particle = addParticle('slow');
trackMaster.insertMultiple( TweenLite.from( $('.slow')[i], Math.random() * 20, { left:'+=200', ease: Linear.easeNone, repeat: -1 }), 0 );
}
function midAnimation(){
trackMaster.time(8);
}
$('#restart').on('click', function(){
trackMaster.restart();
});
$('#pause').on('click', function(){
trackMaster.pause();
});
$('#resume').on('click', function(){
trackMaster.resume();
});
我正在应用repeat: -1
选项。如果我repeat: 2
......
答案 0 :(得分:2)
更改: trackMaster.insertMultiple( TweenLite.from( $('.slow')[i], Math.random() * 20, { left:'+=200', ease: Linear.easeNone, repeat: -1 }), 0 );
来: trackMaster.from( $('.slow')[i], Math.random() * 20, { left:'+=200', ease: Linear.easeNone, repeat: 33 }, 0 );