0
I created a function that when the mouse went over the DIV, it would make an animation by inserting and removing classes. But what I don’t understand is that the animation that’s inside the Queue, only works the first time. When I mouse again, it doesn’t work. I even tried to use the.log() console to see what it was, and actually, after the second time, it didn’t even enter Queue.
divTarget2.hover(function(){
console.log(stats);
$(this).find('img').addClass('anima-doenca-hover').delay(1000).
queue(function(){
console.log('entrou na queue');
$(this).parent().addClass('anima-caixa-hover');
console.log(stats);
});
soundEffect.play();
}).mouseleave(function(){
$(this).find('img').removeClass('anima-doenca-hover');
$(this).removeClass('anima-caixa-hover');
soundEffect.pause();
soundEffect.currentTime = 0;
console.log(stats);
});
When you take out the mouse, it returns to the original state ?
– Wan
Yes, when I take the mouse it removes the class and returns the original straight. The problem is when I try to move the mouse again, it only runs one of the animations, but the one inside Queue no longer runs.But what I don’t understand, is that the first time I pass the mouse it works right.
– Wendel Luiz