JSFiddle - React, Tailwind, and code Playground
by mrtsherman
HTML
<img src="http://blog.clinttorres.com/wp-content/uploads/2008/04/diy_projector-7.jpg" /><br />
ads
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</ul>
JavaScript
$(document).ready( function() {
//$('li').each( function(index, element) { alert(index); } );
var targetheight = 100;
$("img").each( function(index, element) {
var height = $(this).css('height');
var width = $(this).css('width');
if (height > targetheight) {
var ratio = height / targetheight;
$(this).css('height', targetheight);
$(this).css('width', width / ratio);
}
});
});