Jump to content
Search Community

How to execute my function when the animations end

Yuanyuanya test
Moderator Tag

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}})
    
    loginTimeLine.to([LoginElement.current],{
      x:300,rotation:"+=360", transformOrigin:"50% 50%",
    })
      .to([account.current],{
      rotation:"-=90",transformOrigin:"0% 20%",delay:-0.5
    })
      .to([password.current],{x:50,delay:-3.5})
      .to(()=>{
      console.log('hello')
    })
  }
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...