JDK Posted February 11, 2022 Share Posted February 11, 2022 I'm using Vite + Vue to play with GSAP, I want to create a dropdown menu sidebar but I'm stucking at doing reverse animation to make the dropdown collapse. I tried to use this line blow and when I added the animation can not be triggered. How should I do for this situation? tl.reversed() ? tl.play() : tl.reverse(); Here is my code on StackBlitz: https://stackblitz.com/edit/vitejs-vite-jptdfr?file=src%2FApp.vue&terminal=dev Link to comment Share on other sites More sharing options...
Dentsu Creative CZ Posted February 11, 2022 Share Posted February 11, 2022 I dont think this is realated to the GSAP. You need to properly setup your timeline - only once in `mounted` method. You need to manage app state by Vue, not by gsap. So at the end you will have something like this if (this.isMenuOpen) { tlMenu.reverse(); } else { tlMenu.play(); } 3 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