Skip to content

Instantly share code, notes, and snippets.

@ronaldroe
Created January 11, 2021 00:40
Show Gist options
  • Save ronaldroe/04ee7d1b077e13d5a85abc63c2bc5e87 to your computer and use it in GitHub Desktop.
Save ronaldroe/04ee7d1b077e13d5a85abc63c2bc5e87 to your computer and use it in GitHub Desktop.

Revisions

  1. ronaldroe created this gist Jan 11, 2021.
    19 changes: 19 additions & 0 deletions WTF.js
    Original 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();