2012-02-14 8 views
1

私は、次のアニメーションがあります。私はあなたのマウスオフと立て続けに回数を超える場合には効果をアップキューイングからアニメーションを停止するにはどうすればよい停止jQueryのアニメーションループ

http://jsfiddle.net/jtqcj/2/

jQuery("#fp-small-feature-1").mouseenter(function(){ 
    jQuery(".bar").animate({width: "264px"},500); 
}); 

jQuery("#fp-small-feature-1").mouseleave(function(){ 
    jQuery(".bar").animate({width: "0px"},800); 
}); 

を。

+0

ベター・重複:http://stackoverflow.com/questions/9113568/jquery-stop-repeating-animation-on-multiple-rollovers –

答えて

6
jQuery(document).ready(function(){ 
jQuery("#fp-small-feature-1").mouseenter(function(){ 
    jQuery(".bar").stop().animate({width: "264px"},500); 
}); 

jQuery("#fp-small-feature-1").mouseleave(function(){ 
    jQuery(".bar").stop().animate({width: "0px"},800); 
}); 

});​ 
+0

ふざけんなよ! 30秒で私を打つ! – YonoRan

+1

:)私は一番速い男です;) – Yorgo

+1

誰かが同じ問題で2,3日前に質問しました...あなたはどちらも緩んでいます;) –

関連する問題