Jump to content
Search Community

pinning a section is changing the start and end value of other scroll trigger

wetwhite

Go to solution Solved by Cassie,

Recommended Posts

Posted

pinning a section with lottie animation with scrolltrigger offsets the start and end value of the other scrolltrigger

See the Pen wvbeyBy by wetwhite (@wetwhite) on CodePen.

  • Solution
Posted

Hi there!

 

This is because it's important to create your ScrollTriggers in the order they appear on the page.

You have an event listener wrapped around the first one, waiting for the data to be ready, so the last ScrollTrigger is created before the first one.

You can call ScrollTrigger.sort() to fix this issue.

See the Pen BaeZrbo by GreenSock (@GreenSock) on CodePen.



I've also rewritten your final tween as it's not animating anything so it makes more sense as a standalone ScrollTrigger,

hope this helps!

  • Like 1
Posted
56 minutes ago, Cassie said:

Hi there!

 

This is because it's important to create your ScrollTriggers in the order they appear on the page.

You have an event listener wrapped around the first one, waiting for the data to be ready, so the last ScrollTrigger is created before the first one.

You can call ScrollTrigger.sort() to fix this issue.
 

 


I've also rewritten your final tween as it's not animating anything so it makes more sense as a standalone ScrollTrigger,

hope this helps!

 

Thank you.

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