MediaWiki: Common.js

From Spire Trading Inc.
Jump to: navigation, search
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: $(window).on('load', function() { $(window).trigger('resize'); });")
 
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. */
 
$(window).on('load', function() {
 
$(window).on('load', function() {
     $(window).trigger('resize');
+
     setTimeout(function() {
 +
        var $footer = $('#footer');
 +
        $footer.css('margin-top', '0');
 +
        var contentHeight = $footer.offset().top + $footer.outerHeight();
 +
        var windowHeight = $(window).height();
 +
        if (contentHeight < windowHeight) {
 +
            $footer.css('margin-top', (windowHeight - contentHeight) + 'px');
 +
        }
 +
    }, 100);
 
});
 
});

Revision as of 18:36, 27 May 2026

/* Any JavaScript here will be loaded for all users on every page load. */
$(window).on('load', function() {
    setTimeout(function() {
        var $footer = $('#footer');
        $footer.css('margin-top', '0');
        var contentHeight = $footer.offset().top + $footer.outerHeight();
        var windowHeight = $(window).height();
        if (contentHeight < windowHeight) {
            $footer.css('margin-top', (windowHeight - contentHeight) + 'px');
        }
    }, 100);
});