Difference between revisions of "User:P4wn4g3/common.js"

From FreeSpace Wiki
Jump to: navigation, search
(Created page with "JAVASCRIPT FIX: Forces image scaling in the Medal Box: $(document).ready(function() { // Select the table by its style attribute to target the Medal Box specifically...")
(No difference)

Revision as of 07:57, 1 October 2025

/* JAVASCRIPT FIX: Forces image scaling in the Medal Box */
$(document).ready(function() {
    // Select the table by its style attribute to target the Medal Box specifically
    var $medalTable = $('table[style*="border-collapse"]'); 
    
    // Target all images within that table
    $medalTable.find('img').each(function() {
        var $img = $(this);
        var originalWidth = 480; // The desired maximum width of the image

        // Manually override the width property to enforce responsiveness
        $img.css({
            'max-width': originalWidth + 'px',
            'width': '100%' 
        });
    });
});