5,960
edits
No edit summary |
No edit summary |
||
Line 119: | Line 119: | ||
drawerButtonsArray.forEach(function(x){ | drawerButtonsArray.forEach(function(x){ | ||
var i = 1; | var i = 1; | ||
x.addEventListener("click", function( | x.addEventListener("click", function(){ | ||
drawerShowHide(i); | |||
}); | }); | ||
i++; | i++; | ||
}); | }); | ||
function drawerShowHide(x) { | |||
var content = document.getElementById("drawer-"+x); //outputs something like document.getElementById("drawer-1") | |||
var button = document.getElementById("drawer-button-"+x); //outputs something like document.getElementById("drawer-button-1") | |||
if (content.style.display == "block") { | |||
content.style.display = "none"; | |||
button.innerHTML = "Expand"; | |||
} else { | |||
content.style.display = "block"; | |||
button.innerHTML = "Collapse"; | |||
} | |||
} | |||
/* ======================================= Matomo tracking code ======================================= */ | /* ======================================= Matomo tracking code ======================================= */ |