Hello,
I am animating three divs according to three variables I request from a server:
this.onload = function(){
var tldot = new TimelineMax({delay:0, repeat:-1});
tldot.add( TweenMax.to(".bgdot", <%= 1/windSpeed1 * 100 %>, {backgroundPosition:"100px center", ease:Linear.easeNone}) );
var tldash = new TimelineMax({delay:0, repeat:-1});
tldash.add( TweenMax.to(".bgwave", <%= 1/windSpeed2 * 100 %>, {backgroundPosition:"100px center", ease:Linear.easeNone}) );
var tlwave = new TimelineMax({delay:0, repeat:-1});
tlwave.add( TweenMax.to(".bgdash", <%= 1/windSpeed3 * 100 %>, {backgroundPosition:"100px center", ease:Linear.easeNone}) );
};
I am trying to make periodic server requests that will alter the speed of the animation according to the new values passed by the variables.
I tried to do this manually by doing using tweenmax:
window.setTimeout(function() {
TweenMax.to(".bgdot", <%= windSpeed1 %>, {backgroundPosition:"-100px center", ease:Linear.easeNone, repeat:-1});
}, 5000);
But since this affects an ongoing animation it makes a bump.
Is there any way I can alter the speed and keep the flow of the loop? If so, how do I add it to the current TimelineMax I created?
Thanks,
João