Common.js: Difference between revisions
From Engineering Client Portal
LaMarHolmes (talk | contribs) No edit summary |
LaMarHolmes (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
/* Make the hamburger icon collapse the side menu -La Mar */ | /* Make the hamburger icon collapse the side menu -La Mar */ | ||
document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList); | document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList); | ||
document.getElementById("toc").childNodes[3].style.display = 'none'; | |||
function collapseSideList(){ | function collapseSideList(){ | ||
var hamburger = document.getElementById("toc").childNodes[3]; | var hamburger = document.getElementById("toc").childNodes[3]; | ||
if(hamburger.style.display == ''){ | |||
hamburger.style.display = " | if(hamburger.style.display == 'none'){ | ||
hamburger.style.display = ""; | |||
} else{ | } else{ | ||
hamburger.style.display = ""; | hamburger.style.display = "none"; | ||
} | } | ||
} | } |
Latest revision as of 21:29, 9 August 2024
/* Any JavaScript here will be loaded for all users on every page load. */
/* Make the hamburger icon collapse the side menu -La Mar */
document.getElementsByClassName("toctogglespan")[0].addEventListener("click", collapseSideList);
document.getElementById("toc").childNodes[3].style.display = 'none';
function collapseSideList(){
var hamburger = document.getElementById("toc").childNodes[3];
if(hamburger.style.display == 'none'){
hamburger.style.display = "";
} else{
hamburger.style.display = "none";
}
}