I want the to destroy the animation when is complete animating. tried addEventListener
that didn't work.
anim = bodymovin.loadAnimation(params);
animContainer.addEventListener("complete", myScript);
function myScript(){
anim.destroy();
}
I want the to destroy the animation when is complete animating. tried addEventListener
that didn't work.
anim = bodymovin.loadAnimation(params);
animContainer.addEventListener("complete", myScript);
function myScript(){
anim.destroy();
}
anim = bodymovin.loadAnimation(animData);
anim.addEventListener("complete", function() {
anim.destroy();
});
One way to go would be to listen for native 'transitionend' event on the element that is being animated.
element.addEventListener("transitionend", anim.destroy());
The following coded work...
anim.addEventListener("complete", function(){
anim.destroy());
});