Share Posted January 13 I would like to play the reverse (text is deleted) at twice the speed of when it plays forward (text types in). Is this possible, prehaps using time scale somehow? See the Pen xxJqjKv?editors=1010 by garethworld (@garethworld) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted January 13 Hi, This should work the way you intend: var type = gsap.timeline({ repeat: -1 }); var defaults = { opacity: 1, yoyo: true, repeat: 1, repeatDelay: 1, delay: 1, onRepeat() { type.timeScale(4); }, onStart() { type.timeScale(1); } }; Is a peculiar setup so we have to access the parent timeline on each instance as modifying the timescale of each instance won't work as you expect. Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
Author Share Posted January 13 Thank you that works great. When you say it's a peculiar setup, is there a better way to do this? Link to comment Share on other sites More sharing options...
Share Posted January 13 22 minutes ago, gareth said: When you say it's a peculiar setup, is there a better way to do this? I don't know I'll have to dig deep into it and see if there is another way. Basically what could throw some users off is the fact that the approach is updating the parent timeline's timescale and not the specific instance's timescale. In those cases you should always work with the parent timeline since that's the one actively affecting each tween's playhead. That's something it might take some time to sink in if you're starting with GSAP, but when you get a grasp on the concept it becomes second nature. Timelines are just containers of Tweens with some additional options and properties of course. Good luck with your project! 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