Skip to content

Instantly share code, notes, and snippets.

@Bradcomp
Created September 3, 2016 00:08
Show Gist options
  • Save Bradcomp/a9ef2ef322a8e8017443b626208999c1 to your computer and use it in GitHub Desktop.
Save Bradcomp/a9ef2ef322a8e8017443b626208999c1 to your computer and use it in GitHub Desktop.
Toggles the .is-active class for a hamburger menu
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment