Jump to content
Search Community

Timeline Reverse Function suppressEvents parameter value as false - not working

Shoaib Hafeez test
Moderator Tag

Recommended Posts

Hi,

 

I have a timeline and I wish to reverse play my animation but till a certain point (label/tween), I found that I can reverse my animation using the ".reverse()" function but I can't tell it where to stop when reversing. So I have added "timeline.pause()" statement in "onComplete" callback of a tween and found that ".reverse()" has this 2nd parameter that can allow callback events to trigger but in my case its not working, I have added the codepen URL as well.

Please help.

See the Pen LYVQbjM by ImranBug (@ImranBug) on CodePen

Link to comment
Share on other sites

Welcome to the forums, @Shoaib Hafeez. Yeah, I think you may be overcomplicating things - it'd be cleaner to just use a tweenTo() or tweenFromTo() as @mikel suggested. 

 

And for the record, the suppressEvents parameter of reverse() is only relevant if you define a "from" parameter which tells the playhead to jump to a different spot and reverse from there. Think of "suppressEvents" as if it makes the playhead lift up and move to the new position WITHOUT triggering any callbacks inbetween the old and new position, like a record player needle getting picked up and moved instead of dragging over the record. In your case, you had the "from" parameter set to null, thus the playhead doesn't get moved anywhere else, so suppressEvents is totally irrelevant. 

 

Does that clear things up? 

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