buster808 Posted May 26, 2021 Share Posted May 26, 2021 HI, When I resize the window the scroll-trigger animation stops working but the lottie trigger animation is fine. I'm using smooth-scrollbar but had same issue using locomotive. On Mac Chrome Thanks See the Pen gOmReEY by buster808 (@buster808) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted May 26, 2021 Solution Share Posted May 26, 2021 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? 1 1 Link to comment Share on other sites More sharing options...
buster808 Posted May 26, 2021 Author Share Posted May 26, 2021 Yes thanks exactly what I was expecting perfect 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now