Jump to content


How to use onComplete method to tweak previously defined animation property

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi i hope this is a simple one, and the question is how we can use onComplete method to tweak previous define animation property. i tried onCompleteParams but i didn't get that clearly. so if anyone can explain it bit more clearly it would be great .... 



TweenMax.to($item, 1, {
    height: '0 %' ,
    onComplete: function() {
         // i want to tweak display:'block' property to display:'none'
         TweenMax.to($line, .5, {
         drawSVG: "0%",
         immediateRender: false
Link to comment
Share on other sites

  • Solution

Hi Yashi  :)


Pls try like this : 

TweenMax.to(myDiv,2,{x:200,y:200,onComplete:function(){  TweenMax.set(this.target,{x:0}) } });


TweenMax.to(myDiv,2,{x:200,y:200,onComplete:function(){  TweenMax.set(this.target,{clearProps:'x'}) } });
  • Like 2
Link to comment
Share on other sites

Thank @Diaco, you saved me.... thank you very much and it worked.. !!!! :) :) :)

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.