Jump to content

MediaWiki:Common.js: Difference between revisions

From nUSA Wiki
No edit summary
Tag: Reverted
Blanked the page
Tags: Blanking Manual revert
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
document.addEventListener("DOMContentLoaded", function() {
    const collapsibleHeaders = document.querySelectorAll('.infobox-header');


    collapsibleHeaders.forEach(function(header) {
        header.addEventListener('click', function() {
            const group = header.parentElement;
            group.classList.toggle('open');
            const content = group.querySelector('.infobox-content');
            if (content) {
                content.style.display = group.classList.contains('open') ? 'block' : 'none';
            }
        });
    });
});

Latest revision as of 01:01, 14 January 2025