JSFiddle - React, Tailwind, and code Playground

HTML

<div><img src="http://i.imgur.com/sbyPaAsl.jpg" alt=""></div>

CSS

div {
    width: 100%;
    height: 300px;
	overflow:hidden;
}
img {
    width: auto;
    height: 100%;
}
div, img {
    transition: transform 1s linear;/* Other easing function make no difference */
	/* transform-origin:left top; Makes no difference */
}
div.scaled {
	transform:scaleY(0.5);
}
div.scaled img {
	transform:scaleY(2);/* 1 / 0.5 */
}

JavaScript

var $div = $('div');

$div.on('click', function() {

    $div.toggleClass('scaled');

});