Jump to content
Search Community

Unwanted repeat instance of Lottie in next div...

Mattrudd test
Moderator Tag

Recommended Posts

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.

 

image.thumb.png.5d90094a58bb62da7846b35709b7f8c1.png

 

(PS - just a sample animation... wish I was really adding a giant disco ball... 🕺)

Link to comment
Share on other sites

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

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