Jump to content
Search Community

Hamburger Menu opens when clicking "href" on any page

djdutchy

Recommended Posts

Posted

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.

Posted

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
Posted

Ok thank you and I will have a look. 

Posted

Should I close the topic ?

Posted

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

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...