Jump to content
Search Community

Pin container div in tl during internal scrollTrigger animations

brennamacquarrie test
Moderator Tag

Recommended Posts

Hi! 

I want to achieve the effect that the purple circle scrolls all the way into view before the black div appears. I thought that pinning the container would achieve this, but the whole screen is continuing to scroll during the .from animation

 

I was referencing this excellent example but could not recreate. Do I need to make this container like 200vh to allow "scroll time" for the circle's animation to complete? Seems there must be a better way 🤔 TIA!

 

See the Pen KKxRPRR?editors=0111 by BMacQuarrie (@BMacQuarrie) on CodePen

Link to comment
Share on other sites

hey mvaneijgen - thanks for taking a look!

I had seen it done both ways (tl in context and tl above context) and wasn't sure what was best practices - thank you for pointing that out! i also noticed i could be storing my tl in a ref.

 

I think what I was mostly missing (missing the concept with my brain) was setting the bottom of the animation to "farther" away, instead of "bottom top". I'm using 2000px and it's working much closer to how I imagined :) 

 

  • Like 1
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...