Mattrudd Posted August 18, 2022 Share Posted August 18, 2022 Experiencing a strange repeat instance of a Lottie animation in my project... The top disco ball on black is the expected instance, and the one showing in the next div down (purple) isn't wanted/ I've been sure to retain the ScrollTrigger.refresh in the helper function Fully appreciate that a demo is likely required to showcase the issue, but as I'm not sure which bits of code are conflicting it's a tough one for me to strip down into a simple pen! The way I'm setting up the lottie/scrolltrigger animation works on its own without any repeating, but when I add it in with a bunch of other GSAP animations (as well as ScrollSmoother and barba.js) the second view of it in the next div appears. Long shot with what I'm able to provide here but figured one of you experts might know of a common cause? It's bound to be some of my dodgy code clashing with the Lottie helper function. I've been sure to keep the ScrollTrigger.refresh in there, but not sure what could be causing this? I'd fade it out with an onComplete after the full Lottie has scrubbed through, but that's not a good fit for the page. (PS - just a sample animation... wish I was really adding a giant disco ball... 🕺) Link to comment Share on other sites More sharing options...
GreenSock Posted August 18, 2022 Share Posted August 18, 2022 Yeah, it's pretty much impossible for us to troubleshoot by looking at a screenshot. I'd add console.log() calls right before you're creating the Lottie/ScrollTrigger stuff just to see if it's getting called more times than you thought. Perhaps you're accidentally duplicating stuff. 🤷♂️ I think you'll find that if you push yourself to create a minimal demo and slowly build it up to be closer and closer to the "real" thing, you'll stumble upon the problem yourself and know exactly what is causing it. That's normally how it goes. 1 Link to comment Share on other sites More sharing options...
Mattrudd Posted August 18, 2022 Author Share Posted August 18, 2022 I though as much - thanks @GreenSock - it was a function that wasn't necessary. Thanks for the nudge to break it down and build it back up - that did the trick! 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