Jump to content
Search Community

I can't reverse my menu animation

clhomme test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hello everyone! Sorry to bother you again.

 

So, I made an animation for my menu opening and closing. It works fine when it opens, but my issue is, it doesn't work when I close it. I want to have the same animation play but in the opposite direction. I tried using the reverse() method, and its cousin reversed() (the one you see in my codepen, but it didn't work. I tried creating another animation with the opposite x value, but it didn't work either.

 

Thank you to anyone willing to help me ^^

See the Pen WNgWmzY by Dhandelyon (@Dhandelyon) on CodePen

Link to comment
Share on other sites

  • Solution

Hi,

 

Your <nav> element is also being animated at the same time as the links, but using CSS animations. Maybe that's causing the problem. I removed that part of your CSS and it seems to work as expected:

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

 

Unfortunately we don't have the time resources to fix every part of your example. But if you want to animate the entire <nav> tag as well as the links, I'd suggest you to do that with GSAP as well, since managing GSAP and CSS animations could become quite a pickle.

 

Hopefully this helps.

Happy Tweening!

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