JSFiddle - React, Tailwind, and code Playground
HTML
<div class="mydiv">
<img class="myimg" src="http://www.google.com.np/intl/en_com/images/srpr/logo1w.png" />
</div>
<a href="#" class="change">Change</a>
CSS
.myimg {
width:200px;
border:none;
}
.mydiv { width:200px;border: 1px solid #f00; }
JavaScript
$(".change").click(function() {
$(".mydiv").fadeOut('slow');
$(".myimg").attr("src",'');
$(".myimg").attr("src","http://forum.bitdefender.com/style_images/3/rss.png");
var newheight = $(".myimg").height();
$(".mydiv").css("height",newheight+"px");
$(".mydiv").fadeIn('slow');
});