Jump to content
Search Community

Preloader with Lottie-web and Gsap 3

ody test
Moderator Tag

Recommended Posts

Hey ody and welcome to the GreenSock forums,

 

If you go to the function that's looking for $progressBarTop_onEnterFrameListener, and you console.log(this); you can see that this is undefined. So that (wrong context) is your issue. You can fix it by using .call() and passing in this when calling the function: gsap.ticker.add(t._onEnterFrameListener.call(this));

Link to comment
Share on other sites

Sorry, but your code is sooooooooooooo hard to read with all those (),((((((()))),((()),((((),((()))). It took me 10 minutes just to figure out where to start.

 

You would need to bind it.

t._onEnterFrameListener = t._onEnterFrameListener.bind(t);
gsap.ticker.add(t._onEnterFrameListener);

 

 

 

  • Like 4
Link to comment
Share on other sites

7 minutes ago, OSUblake said:

Sorry, but your code is sooooooooooooo hard to read with all those (),((((((()))),((()),((((),((()))). It took me 10 minutes just to figure out where to start.

? You right, i'm still learning i would perform myself and using good style/best practise!

In the meantime, the advise you gave solve the error! Thank you!

See the Pen mdybxWg by odylight (@odylight) on CodePen

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