MediaWiki
Foreground.js: Difference between revisions
From Grouse House Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
/* Collapsible Headers */ | /* Collapsible Headers */ | ||
var coll = document.getElementsByClassName( | var coll = document.getElementsByClassName("h-collapse"); | ||
var i; | var i; | ||
Revision as of 23:37, 31 January 2024
/* Collapsible Headers */ var coll = document.getElementsByClassName("h-collapse"); var i; for (i = 0; i < coll.length; i++) { coll[i].addEventListener("click", function() { this.classList.toggle("active"); var content = this.nextElementSibling; if (content.style.display === "block") { content.style.display = "none"; } else { content.style.display = "block"; } }); }