Share Posted March 7, 2017 Hi, I want to play a Portion of my timeline - by seconds, progress or frames (whatever). For example: 1) Timeline is 10 secs 2) I want to play from 5 sec to 7 sec. 3) Add pause I think will not serve very well, as those portions change dynamically :/ Can't figure out from documentation, how to do this. Link to comment Share on other sites More sharing options...
Share Posted March 7, 2017 Look at .tweenFromTo(). 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 7, 2017 Look at .tweenFromTo(). Sadly, but I want to use TimelineLite, because min library size is critical in this project Link to comment Share on other sites More sharing options...
Share Posted March 7, 2017 You can tween the progress, time, etc of a timeline with a regular tween. TweenLite.fromTo(myTimeline, 2, { time: 5}, { time: 7, ease: Linear.easeNone }); 2 Link to comment Share on other sites More sharing options...
Share Posted March 7, 2017 And if you're worried about file size, use a CDN. It stays cached in a users browser for up to a year. 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 7, 2017 And if you're worried about file size, use a CDN. It's gets cached in a users browser for up to a year. True, but first time loads are also important Link to comment Share on other sites More sharing options...
Share Posted March 7, 2017 True, but CDNs are faster, and there's a good chance that GSAP is already cached. Last time I checked, GSAP was in the top 20 most used libraries, so it's not obscure. I would worry about optimizing assets like images, fonts, and css, over libraries that can served over a CDN, but to each their own. 1 Link to comment Share on other sites More sharing options...
Share Posted March 7, 2017 I'd echo Blake's sentiments. And really, the difference between TimelineLite and TimelineMax is very minor, especially in the context of all the other assets you're loading. It might make your page load 20ms faster for the typical user (totally guessing) which is imperceptible. Also keep in mind that you may have to write more custom code to achieve the effects you want, like instead of .tweenFromTo(), you have to write a whole tween (or more), so it may end up costing you just as much in terms of kb (or more) to go with TimelineLite instead of TimelineMax. But it's totally up to you, of course. I just see a lot of people myopically focus on file size instead of actual performance. Please read http://greensock.com/kilobyte-conundrum/ Again, I don't mean to criticize or be argumentative at all. Happy tweening! 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