Jump to content
GreenSock

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

onComplete not working with non tweened properties

Go to solution Solved by Cassie,

Recommended Posts

Hi,

 

I'm trying to animate a fade of an element that is hidden.

 

gsap.to( this.$nav, 1, {
  opacity: 1,
  display: 'block',
  onComplete: () => {
    console.log('Open')
  }
});

The onComplete is fired when display block is complete, not the whole animation. If I remove the display block, the onComplete works as expected (after 1 second).

 

Should the onComplete work with all properties?

 

Thanks,

Tom

Link to comment
Share on other sites

  • Solution

Hi Tom!

 

You're right it should run after the entire tween has completed.

I can't recreate this however - could you possibly fork this codepen to demonstrate the issue? Maybe you're using a different version of GSAP?

See the Pen MWvmYYP by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Strange, it's working now, really odd. Will re-open if I replicate again.

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