MediaWiki:Common.js: Difference between revisions
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)) |
m (weird mysterious character) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
$('img').each(function(e) { | $('img').each(function(e) { | ||
if (($(this).height() <= | if (($(this).height() <= 70) || ($(this).width() <= 70)) { | ||
$(this).addClass('tinyimage'); | $(this).addClass('tinyimage'); | ||
} | } | ||
}); | }); | ||
}); | }); |
Latest revision as of 21:08, 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'); } }); });