Skip to content

Instantly share code, notes, and snippets.

@thaoms
Last active June 22, 2017 07:43
Show Gist options
  • Save thaoms/95f2cb36d83c5125efca921981977e2c to your computer and use it in GitHub Desktop.
Save thaoms/95f2cb36d83c5125efca921981977e2c to your computer and use it in GitHub Desktop.
Check if item has class and switch
let first = 'nav-trans';
let second = 'nav-op';
if(this.menu.classList.contains(first)) {
[first, second] = [second, first];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment