mehmettemel Posted August 26, 2020 Share Posted August 26, 2020 hi everyone. I m new about GSAP. while ı m trying to make navbar ı got stucked.My menu button is working but close button doesnt. ı wrote tl.reverse() but it didnt work.what can ı do about this?You can see the code in picture Link to comment Share on other sites More sharing options...
Richard1604 Posted August 26, 2020 Share Posted August 26, 2020 Hi mehmettemel, i have a similar menu with only one button and a toggle switch for state which uses this code: document.querySelector(".toggle").addEventListener("click", doCoolStuff); function doCoolStuff(event) { console.log("coolstuff"); toggle = !toggle; toggle ? action.play() : action.reverse(); } you might be able to use adapt this to your particlular needs. Link to comment Share on other sites More sharing options...
mehmettemel Posted August 26, 2020 Author Share Posted August 26, 2020 49 minutes ago, Richard1604 said: Hi mehmettemel, i have a similar menu with only one button and a toggle switch for state which uses this code: document.querySelector(".toggle").addEventListener("click", doCoolStuff); function doCoolStuff(event) { console.log("coolstuff"); toggle = !toggle; toggle ? action.play() : action.reverse(); } you might be able to use adapt this to your particlular needs. yeah ı know this method. thanks for response but ı want to use close button separetely Link to comment Share on other sites More sharing options...
ZachSaucier Posted August 26, 2020 Share Posted August 26, 2020 Hey mehmettemel and welcome to the GreenSock forums. Why post a picture of your code instead of providing your code? It's more work for you and us. Please create a minimal demo of the issue using something like CodePen as this thread covers if you'd like our help debugging: 1 Link to comment Share on other sites More sharing options...
Visual-Q Posted August 26, 2020 Share Posted August 26, 2020 You're missing the the . for the class selector for close-button in the query. 4 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