Jump to content
Search Community

Chain 2 scrolltrigger animations with the same element pinned(

amapic test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Basically, I would like to chain 2 animations with the same element pinned

If the first animation is limited by:

start: "center center",
    end: "+=900 center"

 

how can I start the second one as the center stays at the center ?

This won't work:

start: "center center",
    end: "+=900 center"

nor this:

start: "center+=900 center",
    end: "+=900 center"

I put in the codepen an example. After the black circles reach the center of the screen, I just would like any other animation to start with the ".flex" element staying at the same place.

Thanks for you help.

See the Pen RwYrpaV by amoP (@amoP) on CodePen

Link to comment
Share on other sites

  • Solution

I think it'd actually be cleaner (if I understand your goal) to just use a Timeline: 

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

 

That way you can add as much animation as you want and it'll just have to pin that element once. 

 

But if you really need to separate them out and not use a Timeline (I doubt it), you can have one ScrollTrigger set its start position to the previous one's end position: 

See the Pen mdGVGGp?editors=1010 by GreenSock (@GreenSock) on CodePen

 

I hope that helps. 

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