JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<div id="container"><img src="http://www.qbn.com/media/depot/cover/image/img/54584609241c5b518d87a6b46b38d6e284a057c1_35300.png" id="your-image" /></div>
CSS
#your-image {
height: 300px;
width: auto;
}
JavaScript
$(document).ready(function() {
//VARS
var mywindow = $(window),
windowWidth = mywindow.width(),
windowHeight = mywindow.height();
//RESIZE FUNCTION
function resizeImg() {
windowHeight = mywindow.height();
$("#your-image").css({height:windowHeight});
}
//ON RESIZE EVENT
mywindow.resize(function() {
resizeImg();
});
//CALL ON INIT
resizeImg();
});