MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
No edit summary
Tag: Manual revert
No edit summary
 
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded", function() {
    var captions = document.querySelectorAll(".clickable-caption .caption-text");
   
    captions.forEach(function(caption) {
        caption.style.cursor = "pointer";
       
        caption.addEventListener("click", function() {
            var expandedText = this.closest('.clickable-caption').querySelector('.expanded-text');
           
            if (expandedText.style.display === "none" || expandedText.style.display === "") {
                expandedText.style.display = "block";
            } else {
                expandedText.style.display = "none";
            }
        });
    });
});

Latest revision as of 04:49, 19 May 2024

/* Any JavaScript here will be loaded for all users on every page load. */