MediaWiki:Common.js: Difference between revisions

From VORE Station Wiki
Jump to navigation Jump to search
(Add support for not wrapping every image in a class to do nearest-neighbor resizing (class defined in Common.css))
 
No edit summary
Line 2: Line 2:
$(document).ready(function() {
$(document).ready(function() {
     $('img').each(function(e) {
     $('img').each(function(e) {
         if (($(this).height() <= 64) && ($(this).width() <= 64)) {
         if (($(this).height() <= 70) || ($(this).width() <= 70)) {
             $(this).addClass('tinyimage');
             $(this).addClass('tinyimage');
         }
         }
     });
     });
});​
});​

Revision as of 22:04, 3 January 2018

/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready(function() {
    $('img').each(function(e) {
        if (($(this).height() <= 70) || ($(this).width() <= 70)) {
            $(this).addClass('tinyimage');
        }
    });
});​