我有兩個事件:奇怪的動畫行爲
$('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