JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://jquery-imagefit-plugin.googlecode.com/svn/trunk/jquery.imagefit-0.2.js"></script>
<div>
    <img id="h5" src="http://www.w3.org/html/logo/downloads/HTML5_Logo_512.png"/>
</div>

CSS

html, body {
   padding: 0;
    margin: 0;
    height: 100%;
}
div {
    height: 100%;
    width: 100%;
}

JavaScript

jQuery(function() {jQuery('#h5').bind('load', function() {
    jQuery('div').imagefit();
})});