I have a simple jQuery hover animation:
jQuery(function($) {
$('.category').hover(function(){
$(this).find('.banner').fadeIn();
},function(){
$(this).find('.banner').fadeOut(400);
});
});
all this does is when someone hovers over the .category
element, the banner div fades in and fades out. Simple.
My problem is that as I have about ten of the .category
elements, if someone moves across them too fast or off and on the same one multiple times jQuery queues the animations and keeps making them appear, disappear until it's caught up.
Is there a simple way to stop this from happening?
I saw another question where it was suggested to add .stop
, but this doesn't work. the animation stops working completely or comes in only half faded in if I move the mouse over and off too many times.
Thanks in advance