Created
January 11, 2021 00:40
-
-
Save ronaldroe/04ee7d1b077e13d5a85abc63c2bc5e87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let nav_buttons = document.querySelectorAll('.nav'); | |
function addNavButtonListeners() { | |
Array.from(nav_buttons).forEach(button => { | |
button.addEventListener('click', e => { | |
console.log(button); | |
e.preventDefault(); | |
if(button.classList.contains('next')){ | |
switchPanel(); | |
return; | |
} | |
switchPanel(-1); | |
}); | |
}); | |
} | |
addNavButtonListeners(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HTML is: