I have added a loader on my page which does the animation for 3 seconds then a function applies styles to the animation to make it not visible. I want to add a fadeout effect when the 'waa' style is applied to the 'load' div.
setTimeout(function() {
document.getElementById('load').className = 'waa';
}, 3000);
.loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
z-index: 9999;
display: block;
}
.waa {
opacity: 0;
}
<div class="loading" id="load"></div>