User:P4wn4g3/common.js
From FreeSpace Wiki
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* 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%'
});
});
});