MediaWiki

Minerva.js: Difference between revisions

From Grouse House Wiki

(Created page with "→‎All JavaScript here will be loaded for users of the MinervaNeue skin: var coll = document.getElementsByTagName('h2'); 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"; } }); }")
Tags: mobile web edit mobile edit
 
No edit summary
 
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
/* All JavaScript here will be loaded for users of the MinervaNeue skin */
var coll = document.getElementsByTagName('h2');
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";
    }
  });
}

Latest revision as of 01:43, 30 January 2024

/* All JavaScript here will be loaded for users of the MinervaNeue skin */