Created
January 11, 2021 00:40
-
-
Save ronaldroe/04ee7d1b077e13d5a85abc63c2bc5e87 to your computer and use it in GitHub Desktop.
Revisions
-
ronaldroe created this gist
Jan 11, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ 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();