I have an animation using bodymovin that triggers when I mouseenter it and I'm trying to make it so that if I mouseover it again before the animation ends, it doesn't restart.
squareAnim.addEventListener('mouseenter', function(){
anim.removeEventListener('loopComplete', loopHandler);
anim.goToAndStop(1);
anim.play();
if(anim.play == true){
anim.mouseenter == false;
} else {
anim.mouseenter == true;
}
});
Am I getting the syntax wrong or is there a flaw in my logic?