JSFiddle - React, Tailwind, and code Playground
HTML
<img id="slide" src="somesource" />
CSS
img {
background: orange;
width: 100px;
height: 100px;
}
JavaScript
$(document).ready(function () {
$('img#slide').animate({ "opacity": .7 })
.hover(function () {
$(this).stop().animate({ "opacity": 1 })
},
function () {
if ( !$(this).hasClass("active") ) {
$(this).stop().animate({ "opacity": .7 });
}
})
.click(function () {
$(this).addClass("active");
});
});