Common.js: Difference between revisions
From Redrock Wiki
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 9: | Line 9: | ||
var content = this.nextElementSibling | var content = this.nextElementSibling | ||
if (content.style.display === "inline") { | if (content.style.display === "inline") { | ||
content.style.display | content.style.cssText = 'display:none !important'; | ||
this.innerHTML = this.innerHTML.replace('-down', '-up'); | this.innerHTML = this.innerHTML.replace('-down', '-up'); | ||
} else { | } else { | ||
content.style.display | content.style.cssText = 'display:inline !important'; | ||
this.innerHTML = this.innerHTML.replace('-up', '-down'); | this.innerHTML = this.innerHTML.replace('-up', '-down'); | ||
} | } | ||
Revision as of 18:16, 9 April 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/* collapsible categories */
$(function () {
var coll = document.getElementsByClassName("collapsibleList");
for (var i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function () {
var content = this.nextElementSibling
if (content.style.display === "inline") {
content.style.cssText = 'display:none !important';
this.innerHTML = this.innerHTML.replace('-down', '-up');
} else {
content.style.cssText = 'display:inline !important';
this.innerHTML = this.innerHTML.replace('-up', '-down');
}
});
}
});