Jump to content
Search Community

Reverse animation, can't figure out how this is implemented

WaReZoR test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

First of all, I want to thank the friendly community, for helping newcomers!
The idea is this, I want to make animation appearance of objects so that when you return the block, all the objects animated in reverse order, that is, began to appear not from top to bottom, but on the reverse, from bottom to top. Adding reverse to toggleActions doesn't work at all, which makes me even more confused.

See the Pen rNpPxdG by warezor-ua (@warezor-ua) on CodePen

Link to comment
Share on other sites

  • Solution

Hi WaReZor,

 

Your toggle action is resetting the animation on leave, so there is nothing to reverse. You're already at the beginning.

 

If I understand your goal correctly, you will probably have to make another animation when entering back, kind of like this.

 

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

 

  • Like 3
Link to comment
Share on other sites

Yes, that's exactly what I wanted to do, but I did not think that so much code is required for this, if you animate the other sections on the same principle, it will be very expensive =(. I thought there was some other method, which I have not yet learned about. In any case there is already some option, it's much better than nothing, thanks!

Link to comment
Share on other sites

I wouldn't say expensive, more like tedious 😉

 

But that's what is needed because the enter back animation is in a different order than the enter one. That's why I had to reverse the items array. You can see that just doing the animation in reverse is not the same thing.

 

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

 

 

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