Jump to content
Search Community

How to animate fixed div with multiple triggers

filips test
Moderator Tag

Recommended Posts

I noticed several problems: 

  1. You were literally trying to animate the "end" property of the various elements. There is no such thing. Were you trying to set the end of the ScrollTrigger?
  2. You were animating the SAME element with a bunch of ScrollTrigger-based tweens which are always rendered immediately by default, so I assume you forgot to set immediateRender: false
  3. If I understood you correctly, you want to make the tweens dynamically pick up where the current size is, thus you should create them dynamically rather than pre-baking 1 tween for each and restarting them. Otherwise, they'll always play to/from the same values each time. That'd be bad, though, if someone scrolls more quickly and interrupts a previous one. 

Perhaps you wanted something more like this?:

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

 

Nice and simple :)

 

Happy tweening!

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