I have a JavaScript function called show_alert.
function show_alert(type='info', $message) {
$('.notifications-area').append(' \
<div class="notification opened ' + type + '"> \
<h5>' + $message + '</h5> \
</div> \
');
setTimeout(function(){
$('.notification').addClass('closed');
}, 4000);
}
The opened and closed CSS classes include keyframes, with the opened one causing it to appear and the closed one causing it to fade away. I also want to clear the HTML after the closing animation completes.