Jump to content
Search Community

How to stagger a scrub animation

alx
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Posted

Hey all! 

This feels like it should be simple enough to do and yet I can't figure it out or find an answer in the forums. 

When you scroll down, the bars scale up until they reach their full height at the end of the 'body'. What I want to simply do is have them 'stagger' on scrub, or if you will, each bar, starting from the left one, begins to scale up only when the previous bar has finished. I can imagine doing this with a scrubbed timeline, but is there an easier way?

 

See the Pen LEPGGRK by alxhrrs (@alxhrrs) on CodePen.

  • Solution
Posted


Hello there, @alx

Just put the stagger where it belongs - on the vars object, not on the scrollTrigger object - and you should be good to go already.
 

1 hour ago, alx said:

This feels like it should be simple enough to do and yet I can't figure it out or find an answer in the forums. 


From my experience, the best places to look for answers on general issues like this, usually are the docs and other ressources like the 'Getting Started' articles.

https://gsap.com/resources/getting-started/Staggers/

I hope this will help. Cheers.

See the Pen dPbGMYO by akapowl (@akapowl) on CodePen.

  • Like 2
Posted

whaaaaaat?! Well don't I look like a goof. Yeah that's exactly what I wanted. I can't believe it was that simple. I'd never put the stagger on the vars. Thanks so much!

  • Like 2

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.
×
×
  • Create New...