これら2つの機能があるとしましょう:
$(".a").animate(
{"left":"100%"},
{duration:10000, complete:function(){
//Something is triggered!! e.g
alert("a");
//Please note: In actual case it is never as simple as alert("a").
}}
);
$(".b").mouseover(function(){
$(".a").stop().animate({"top":"100px"},{duration:5000});
});
これらによると、-ed である
.a限り停止し、トリガーされます。.bmouseoveranimate({"top":"100px"},{duration:5000})しかし、私はそれが-ed のときに
alert("a")一度してからトリガーしたいのです。.bmouseoveranimate({"top":"100px"},{duration:5000})
ただし、この方法で 2 番目の関数を設定することはできません。
$(".b").mouseover(function(){
//something happens! e.g
alert("a");
$(".a").stop().animate({"top":"100px"},{duration:5000});
});
- done
の後に -edの場合は
alert("a")2 回になります。.bmouseover.aanimate
を試しましたstop()がjumpToEnd parameter、理想的ではありません
.bがmouseover-ed になるたびに、 は即座に完了し、にシフトされ.aます。私はそれがどこにあるのか、まだ秒がトリガーされる前に欲しいanimte.aleft:100%stopalert("a")animate
誰かがこれに対する迅速かつ簡単な解決策を提供できれば、私は非常に感謝しています!