MediaWiki: Common.js

From Spire Trading Inc.
Jump to: navigation, search
Tag: Replaced
 
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. */
(function() {
 
    function fixFooter() {
 
        var footer = document.querySelector('#footer.footer-sticky');
 
        if (!footer) return;
 
        var current = parseFloat(window.getComputedStyle(footer).marginTop) || 0;
 
        var additional = window.innerHeight - document.body.offsetHeight;
 
        var newmargin = Math.max(current + additional, 50);
 
        footer.style.marginTop = newmargin + 'px';
 
    }
 
    function init() {
 
        setTimeout(fixFooter, 100);
 
        setTimeout(fixFooter, 500);
 
        setTimeout(fixFooter, 1500);
 
    }
 
    if (document.readyState === 'loading') {
 
        document.addEventListener('DOMContentLoaded', init);
 
    } else {
 
        init();
 
    }
 
})();
 

Latest revision as of 18:54, 27 May 2026

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