Jump to content

MediaWiki:Common.js: Difference between revisions

From nUSA Wiki
No edit summary
Tag: Reverted
Blanked the page
Tags: Blanking Manual revert
 
Line 1: Line 1:
document.addEventListener("DOMContentLoaded", function() {
    // Get all toggle headers (sections)
    const toggleHeaders = document.querySelectorAll('.toggle-header');


    toggleHeaders.forEach(function(header) {
        // Add click event listener to each header
        header.addEventListener('click', function() {
            // Find the content to toggle (it's the next sibling)
            const content = header.nextElementSibling;
            // Toggle the visibility of the content
            if (content && content.classList.contains('toggle-content')) {
                content.style.display = (content.style.display === 'none' || content.style.display === '') ? 'block' : 'none';
            }
        });
    });
});

Latest revision as of 01:01, 14 January 2025