JSFiddle - React, Tailwind, and code Playground

by Norbert Wilms

HTML

<div class="container">
 <img src="http://images.freeimages.com/images/previews/cf6/bird-1394216.jpg" id="image_resize" width="20%" height="20%">
 <img id="img1" src="http://images.freeimages.com/images/previews/4f3/apple-1322812.jpg">
</div>

CSS

.container {
  position: relative;
  width: 300px;
  height:200px;
}

JavaScript

$(document).ready(function() {
var percent = 0;
	$('#img1').css({'width': '1%', 'height': '1%'});
var myInterval1 = window.setInterval(function() {
	$('#img1').css({'width': percent+"%", 'height': percent+"%"});
  percent ++;
  if(percent > 100) {
  	clearInterval(myInterval1);
  }
}, 50);
});