Share Posted March 8, 2022 Hello everyone! I got a hamburger menu that hides and shows on scroll up/down, using code from another forum post. Using ScrollTrigger.matchMedia I am limiting this behavior to mobile devices only (larger screen size set in the demo to demonstrate behavior more easily). How do I make the hamburger stay in place when the menu is open? Currently is scrolls out of the way even if the menu is open, which isn't very userfriendly. Any help would be greatly appreciated! Thanks! See the Pen abVrZqE by aStingl (@aStingl) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted March 8, 2022 Hi Alexander, You can put a condition inside your onUpdate to return if it's open. See the Pen PoOvaGJ by GreenSock (@GreenSock) on CodePen 2 Link to comment Share on other sites More sharing options...
Author Share Posted March 8, 2022 Thank you so much! You are indeed a Superhero! 2 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