I have a lottie animation playing one time. When it completes playing I want to fade it out.
What is the best way to do it?
I am trying to fade in and out SVG lottie animations.
var params = {
container: document.getElementById('lottie'),
renderer: 'svg',
loop: false,
autoplay: false,
animationData: animationData
};
var anim;
anim = lottie.loadAnimation(params);
anim.addEventListener('DOMLoaded',function() {
anim.play();
});
anim.addEventListener('complete',function() {
//anim.destroy();
// fade out code...
});