User:P4wn4g3/common.js: Difference between revisions

P4wn4g3 (talk | contribs)
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..."
 
P4wn4g3 (talk | contribs)
Blanked the page
Tag: Blanking
 
Line 1: Line 1:
/* 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%'
        });
    });
});

Latest revision as of 07:59, 1 October 2025