Mohamedgad Posted June 3, 2021 Share Posted June 3, 2021 Hello, I have an issue with my popup menu, everything is working except when I'm on the very bottom of the page and click on the menu button, the menu popup appear normally but, also scroll all the page up. is there any way to prevent the scroll top that happen when I open the menu while I'm on the bottom of the page. Thanks for help in advance. See the Pen VwpQObE by Mohamed-Gad (@Mohamed-Gad) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted June 3, 2021 Share Posted June 3, 2021 Hello there @Mohamedgad That is happening because you are using href="#" on your anchor links - you probably shouldn't do that as it points to a non-defined anchor which will default back to the top of the page - so on click your page will be set to the top here. That is something general you'd want to consider tweeking - not at all related to GSAP. I just left the href empty and added e.preventDefault() to your click-listener functions to show the difference it makes. I'm not saying that is the best approach to use though. That is up to you to find out Happy tweening! See the Pen e258ad108a78c4cf49e569d340ba3a83 by akapowl (@akapowl) on CodePen 4 Link to comment Share on other sites More sharing options...
Mohamedgad Posted June 3, 2021 Author Share Posted June 3, 2021 Thanks alot for the information, i will definitely considering your advice. 🤩 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