Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Hamburger Menu opens when clicking "href" on any page

Recommended Posts

My gsap menu works fine. The problem is, when I click any other "<a href>" on the page, the menu will open too. You can check my codepen.

I don't know, how to solve this. Can you please help me.


It includes Chrome, Firefox. Not tested in IE.


Thanks in advance

See the Pen oNxXXdy by DJdutchy (@DJdutchy) on CodePen

Link to comment
Share on other sites

Hi @djdutchy


Welcome to the forum


That's what I would expect to happen because you have two listeners. One for the button and one for any <a> tag. They both reverse the timeline. You could just remove the second one and the menu would open and close only with the toggle button.


Also note that you're using the new GSAP 3 files, but the old GSAP 2 syntax. You may want to take a look at the GSAP 3 Migration Guide.

Happy tweening and welcome aboard.



  • Like 2
Link to comment
Share on other sites

Ok thank you and I will have a look. 

Link to comment
Share on other sites

Nope. It's fine. Maybe it'll help someone in the future.


Let us know if you have any GSAP related questions. Happy tweening. :)


  • Like 2
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.