-
Notifications
You must be signed in to change notification settings - Fork 0
navbar.mjs
up2108272 edited this page May 8, 2024
·
2 revisions
- Sets functionality for navigation bar on the left side of all pages
function eventListeners() {
let nav_toggle = document.querySelector("#open-nav-btn");
nav = document.querySelector("#nav");
nav_toggle.addEventListener("click", navBarToggle);
}- Allows js to interact with the html page
function navBarToggle(){
if(showing === false) {
nav.classList.add('nav-show');
nav.classList.remove('nav-hide');
showing = true;
return;
}
nav.classList.add('nav-hide');
nav.classList.remove('nav-show');
showing = false;
}- toggles whether the nav bar is displayed
learnforge wiki!