I am using this jquery to try and fade out my image and show whats underneath. It works perfect except when you hover over it multiply times. Then it freaks out and starts going in and out over and over again. Is there something I can do about that?
$('#contentPosters li').hover(function(){
$(this).find('img').fadeOut();
},
function(){
$(this).find('img').fadeIn();
});
Use stop() AND fadeTo
stop() is for stopping current animation.
fadeTo() usage is because when you stop the animation during fadeIn / fadeOut, the opacity will not reset to 100%, and your image will become invisible over the time.