Jump to content
GreenSock

zozo

callback won't fire when paused is true ?

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

I'm I doing something wrong here ?

If paused is true, the callback fire, but not if I use paused and play. 

At first I didn't set second play parameter to false, but even with .play(0.5,false) callback doesn't fire. 

Thanks for help. 

 




function test(){
  console.log('done');
}


var animContPress =  TweenMax.to($("#contpress"), 1, {left:'0',ease:Power2.easeInOut,onComplete:test,paused:true, suppressEvents:false});


animContPress.play(0.5,false);

Link to comment
Share on other sites

ok, made it work like that.

function test(){
  console.log('done');
}


var animContPress =  TweenMax.to($("#contpress"), 1, {left:'0',ease:Power2.easeInOut,paused:true});


animContPress.eventCallback("onComplete", test);

animContPress.play();
        

Witch i find weird because it doesn't make any difference if suppressEvents is set on false or not.

Link to comment
Share on other sites

Sorry my bad, I'm stupid. don't bother reading. Thanks for making Tweenmax so awesome. 

Link to comment
Share on other sites

For a little extra clarity, suppressEvents isn't a valid tween property.

 

The following code isn't proper

TweenMax.to($("#contpress"), 1, {left:'0',ease:Power2.easeInOut,onComplete:test,paused:true, suppressEvents:false})

suppressEvents is a parameter that works with a few methods that are used to control animations, like play() or seek()

 

http://api.greensock.com/js/com/greensock/TimelineLite.html#seek()

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