Share Posted January 8, 2016 Hi there, Is there a basic way to calculate the length of a TimelineMax animation? I do alot of banner work with Greensock and publishers have strict 15sec limits. I can't find an example anywhere. Thanks, Phil Link to comment Share on other sites More sharing options...
Share Posted January 8, 2016 Absolutely. That's what the duration() is for. Or totalDuration() if you want to include all the repeats and repeatDelays. var tl = new TimelineMax(); tl.to(...).to(....); //add stuff console.log("duration is: " + tl.duration()); If you want it to stop after 15 seconds, you have a lot of options... tl.addPause(15); or TweenLite.delayedCall(15, function() { tl.pause(); }); or if you want to be fancy and gradually slow it down after 15 seconds (instead of an abrupt stop): TweenLite.delayedCall(15, function() { TweenLite.to(tl, 1, {timeScale:0, onComplete:function() { tl.pause(); }}); }); Does that help? 7 Link to comment Share on other sites More sharing options...
Author Share Posted January 10, 2016 This absolutely helps! Thank you so much. I love Greensock even more. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now