Jump to content
Search Community

Scroll-trigger animation stops when using smooth scrollbar on window resize

buster808 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

Your demo has:

trigger: ".boxContainer",

But there's no such element. So it's defaulting to the very top of the page. 

 

Also, since you're setting up your ScrollTriggers further down on the page first, and then your Lottie file is loading and THEN it's creating its ScrollTrigger, the start/end values aren't calculated in the correct order. We always recommend that you create your ScrollTriggers in the order they actually occur on the page, but in your case you're doing almost the opposite. So you could call ScrollTrigger.sort() to force it to re-order things according to their placement on the page. I've added that to the LottieScrollTrigger() function and tweaked a few other things in this fork: 

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

 

Is that more like what you were expecting? 

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