jQuery addClass example
Change class name on click in jQuery
by tonytlwu
HTML
<a href="#"><img src="https://s3-eu-west-1.amazonaws.com/fliplet-production/icon.png" /></a>
CSS
/* I've used hover instead of focus */
a {
transition: opacity 0.5s;
cursor: pointer;
pointer-events: all;
}
img {
transition: all 0.5s;
}
img:hover {
transform: rotate(180deg);
}
a:focus img {
opacity: 0;
}
JavaScript
/* $('img').click(function () {
$(this).fadeOut();
}); */