acg Posted February 14, 2022 Share Posted February 14, 2022 When the onStart callback is called I understand the onStartParams array is passed as the params. I have some old code that uses "{self}", but nowadays, I'm not sure that works the same. Can anyone confirm that "{self}" is still a thing? I couldn't find references to it in the docs. What I am mainly trying to understand is what is the best known method to get a reference to the Tween itself from the onStart callback? Thanks! Link to comment Share on other sites More sharing options...
OSUblake Posted February 14, 2022 Share Posted February 14, 2022 self was removed. Just use a normal a function and this will be the same thing. gsap.to(foo, { onStart() { console.log(this); } }) Or you can just use a variable like so. let animation = gsap.to(foo, { onStart() { console.log(animation) } }); 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