Jump to content
Search Community

issue with popup menu

Mohamedgad test
Moderator Tag

Recommended Posts

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

 

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

 

  • Like 4
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...