I'm trying to figure out how to make an image disappear by adding a class
However, when I try this, the element vanishes without any animation
I'd like it to fade away slowly instead
I've heard there are CSS3 properties that can help achieve this effect, but I'm not sure which ones
Although I do know how to animate opacity in CSS, I prefer not to go that route
HTML
<img src="..." class="a">
<button onclick="make_img_disappear()">Click to disappear</button>
CSS
.hide{
display: none;
}
.a{
/*these properties should enable the addition of a class with animation*/
}
JAVASCRIPT
function make_img_disappear(){
$("img").addClass("hide");
}