Multiple Fades (FadeIn, FadeOut, FadeTo) become jittered
I have a galley of 9 images in a row. Each has the class '.galleryitem', and when mouseover any of these, I want the current item to remain 100% visible, but the other 8 items to fade to 50% transparency.
I use this code:
-
$('.galleryitem').live('mouseover',function(){
$('.galleryitem').stop().fadeTo(400,.5);
$(this).stop().fadeTo(0,1);
});
$('.galleryitem').live('mouseout',function(){
$('.galleryitem').stop().fadeTo(400,1);
});
This works fine (although I'm not sure if the second line in the mouseover function is best practice), but after rolling over a few images, they all start to fade very jittery. Almost like something is clogging down the page, like bad garbage collection of sorts.
Does anyone know of a solution to this?
Thanks kindly