JSFiddle - React, Tailwind, and code Playground
HTML
<img src="http://imgs.xkcd.com/comics/bad_ex.png" alt="" />
CSS
img {
cursor: pointer;
}
JavaScript
$('img').click(function() {
var current = $(this);
current.slideUp(300, function() {
current.attr('src', 'http://imgs.xkcd.com/comics/conditional_risk.png').load(function() {
current.slideDown(300);
});
});
});