Pandy Posted August 18, 2021 Share Posted August 18, 2021 Hi 😁 I am new here. I wrote this code and it works but just the first time. If I want to see it work again does not work only if I refresh the page. What does the code do? When I hover the mouse over the Cursos link, the submenu appears with an animation. See the Pen dyWBPVz by sandy-reyes-the-sans (@sandy-reyes-the-sans) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted August 18, 2021 Solution Share Posted August 18, 2021 Welcome to the forums, @Pandy The problem is that you animate to an opacity of 1 and y of -10...and that's it. You never return to the other values when the user rolls their mouse out. So the next time they mouseover, the elements are ALREADY at the destination values (opacity: 1, y: -10) so you don't see any motion. Also, it's pointless to have a stagger in your animation because you're creating it inside a .forEach() loop so there's only ONE element in each of those animations (hence nothing to stagger). I assume you wanted to do something more like this?: See the Pen QWvXjJx?editors=0010 by GreenSock (@GreenSock) on CodePen Does that help? 3 Link to comment Share on other sites More sharing options...
Pandy Posted August 18, 2021 Author Share Posted August 18, 2021 thank u, very much. 😃 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now