Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop menu from opening when back button is clicked #172

Open
devemmastone opened this issue Nov 1, 2019 · 0 comments
Open

Stop menu from opening when back button is clicked #172

devemmastone opened this issue Nov 1, 2019 · 0 comments

Comments

@devemmastone
Copy link

I just have a minor issue and that is when I click on my full screen menu and click on one of the menu items and then click the back button the full screen menu is open again? I know it has something to do with it remembering the last state the page was at before I clicked on an item.

Is there a way to avoid that when using InstantClick?

The script I am using is this one:

/* Open when someone clicks on the span element */
function openNav() {
  document.getElementById("myNav").style.width = "100%";
}

/* Close when someone clicks on the "x" symbol inside the overlay */
function closeNav() {
  document.getElementById("myNav").style.width = "0%";
}

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant