このコードを使用して、マウスがオンのときとマウスが要素を離れたときに2つの画像間でフェードします。これにより、マウスの動きが速すぎると、不適切な遷移が発生します。それを防ぐ方法は?
私のコード:
$('.prods li').live('mouseenter',function() {
$(this).children('.label').stop().animate({top: '80%',opacity: 1}, 800, 'easeOutQuint');
if ($(this).children('.producthover').length) {
$(this).children('.product').fadeOut(800);
$(this).children('.producthover').fadeIn(800);
}
}).live('mouseleave',function() {
$(this).children('.label').stop().animate({top: '50%',opacity: 0}, 800, 'easeOutQuint');
if ($(this).children('.producthover').length) {
$(this).children('.product').fadeIn(800);
$(this).children('.producthover').fadeOut(800);
}
});