Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Jona Anders

How to control scrub animations

Recommended Posts

I have build an scroll animation with a timeline and scrub, and I want to control it, with adding pause to it and with running multiple things at the same time. How can I do this?

Link to post
Share on other sites

Hey Jona and welcome to the GreenSock forums.

 

The ScrollTrigger docs talk about how to create animations that are scrubbed on scroll. Is that what you're looking for? Your post is a bit ambiguous. It'd be helpful if you made a minimal demo showing what you're trying to do and explain what's going wrong:

 

  • Like 1
Link to post
Share on other sites

Thanks for the fast reply!

Sorry that my explaination wasn't good. I try to explain the scrollanimation. I have 3 elements, a,b and c. Element a is moving in x direction. When it reaches 50% of the way, element b should rotate, during element a is moving. Without a pause or something like this. After elemnt a reaches its ending position, element c will change its color.  I have made it a scrub animation, so delay don't work.

Here is a codepen with a simple example what I did:

See the Pen rNerRYY by JonaAnders (@JonaAnders) on CodePen

 

Link to post
Share on other sites

Thanks for the minimal demo! That's very clear.

 

Since the default duration of tweens is 0.5, you should set the start time of the second tween to 0.25. What might make things easier to think about is changing the default duration of the tweens in the timeline to 1 instead. It won't affect the scrub effect but it will make conceptualizing timings a little easier.

 

Here's how I'd set it up:

See the Pen oNxMraV?editors=0010 by GreenSock (@GreenSock) on CodePen

  • Like 2
  • Thanks 1
Link to post
Share on other sites

Thank you very much, you helped me a lot, now it works perfectly!

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×