我有两个事件:奇怪的动画行为
$('li').on({
'mouseover':fadeImgOut,
'mouseout' :fadeImgIn
});
和功能...
function fadeImgOut() {
$(this).find('img').animate({opacity:'.5'}, 1000);
}
function fadeImgIn() {
$(this).find('img').animate({opacity:'1'}, 1000);
}
当我将鼠标悬停在其上时,图像fadeout, fadein and fadeout
,当我移动鼠标移出,图像fadein, fadeout and fadein
再次。
我无法解释这种行为:为什么图像不会在mouseover
上消失,并在mouseout
上消失?
将其更改为鼠标离开/的mouseenter和使用的stop() – epascarello 2013-05-01 02:42:30