.mouseleave()
の代わりに使用.mouseout()
http://jsfiddle.net/uqgz9/4/
var imgW;
$('.brand-box-item').mouseenter(function(){
if($(this).find('img').is(':animated') === false)
imgW = $(this).find('img').width();
$(this).find('img').stop().animate({'width':'0','margin-left':(imgW/2)+'px'},function(){
$(this).css({'margin-top':'-40px'});
$(this).stop().animate({'width':imgW+'px','margin-left':'0'});
});
});
$('.brand-box-item').mouseleave(function(){
$(this).find('img').stop().animate({'width':'0','margin-left':(imgW/2)+'px'},function(){
$(this).css({'margin-top':'0'});
$(this).animate({'width':imgW+'px','margin-left':'0'});
});
});
「mouseleave イベントは、イベント バブリングを処理する方法で mouseout とは異なります。この例で mouseout が使用された場合、マウス ポインターが内部要素の外に移動すると、ハンドラーがトリガーされます。これは通常、望ましくない動作です。mouseleave イベント一方、マウスが子孫ではなく、バインドされている要素を離れたときにのみハンドラーをトリガーします。したがって、この例では、マウスが外側の要素を離れたときにハンドラーがトリガーされますが、内側の要素ではトリガーされません。
-jQuery ドキュメント