0
我需要一種方法來停止在mouse enter()
上觸發的動畫,如果它是mouse leave()
。此時此代碼意味着如果用戶快速滾動然後快速出現,動畫將完成動畫,然後按順序執行mouse leave()
函數,而不是在鼠標離開時停止它的軌跡並從那裏動畫。動畫的JQuery停止()方法
我相信這可以用stop()
函數完成,但我不知道如何使用它。
$(".featuredslider a").mouseenter(function(){
$(this).stop();
$(this).find('.smallcont').animate({opacity:0},400);
$(this).find('.bigcont').animate({opacity:1},400);
});
$(".featuredslider a").mouseleave(function(){
$(this).stop();
$(this).find('.smallcont').animate({opacity:1},400);
$(this).find('.bigcont').animate({opacity:0},400);
});
奇妙... 7分鐘,直到我可以接受 –
沒有probs ... :-)很高興我有幫助 – ManseUK