Common.js: Difference between revisions
From Engineering Client Portal
| LaMarHolmes (talk | contribs) No edit summary Tag: Reverted | LaMarHolmes (talk | contribs)  No edit summary Tag: Reverted | ||
| Line 17: | Line 17: | ||
|     hamburger.style.opacity = 0; |     hamburger.style.opacity = 0; | ||
|     hamburger.style.transition ="0s 2s, opacity 2s linear"; |     hamburger.style.transition ="0s 2s, opacity 2s linear"; | ||
|     setTimeout(displyNone,  |     setTimeout(displyNone, 2000); | ||
| } else{ | } else{ | ||
|   hamburger.style.visibility = ""; |   hamburger.style.visibility = ""; | ||
|   hamburger.style.opacity = 1; |   hamburger.style.opacity = 1; | ||
|   hamburger.style.transition ="2s linear"; |   hamburger.style.transition ="2s linear"; | ||
|  setTimeout(displayNow, 1000); | |||
| } | } | ||
| } | } | ||
Revision as of 19:26, 25 June 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);
function collapseSideList(){
 var  hamburger = document.getElementById("toc").childNodes[3];
 function displyNone(){
   	hamburger.style.display = 'none';
   }
 function displayNow(){
 	hamburger.style.display = '';
 }
 if(hamburger.style.visibility == ''){
   hamburger.style.visibility = "hidden";
   hamburger.style.opacity = 0;
   hamburger.style.transition ="0s 2s, opacity 2s linear";
   setTimeout(displyNone, 2000);
} else{
 hamburger.style.visibility = "";
 hamburger.style.opacity = 1;
 hamburger.style.transition ="2s linear";
 setTimeout(displayNow, 1000);
}
}