Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

How to execute my function when the animations end

Recommended Posts

I want to execute this console.log('hello') when these animations end ,but it doesn't work. Thank you for helping me !!!

const loginPop=()=>{
    const loginTimeLine=gsap.timeline({defaults:{duration:3}})
      x:300,rotation:"+=360", transformOrigin:"50% 50%",
      rotation:"-=90",transformOrigin:"0% 20%",delay:-0.5
Link to comment
Share on other sites

Hi Yuanyuanya,

You're looking for onComplete

Hope this helps!


gsap.to('.target', {
 x: 200,
 onComplete: () => { console.log('beep boop')}


  • Like 2
Link to comment
Share on other sites

Thank you so much!!!Hope you have a good day :)

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