これら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
限り停止し、トリガーされます。.b
mouseover
animate({"top":"100px"},{duration:5000})
しかし、私はそれが-ed のときに
alert("a")
一度してからトリガーしたいのです。.b
mouseover
animate({"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 回になります。.b
mouseover
.a
animate
を試しましたstop()
がjumpToEnd parameter
、理想的ではありません
.b
がmouseover
-ed になるたびに、 は即座に完了し、にシフトされ.a
ます。私はそれがどこにあるのか、まだ秒がトリガーされる前に欲しいanimte
.a
left:100%
stop
alert("a")
animate
誰かがこれに対する迅速かつ簡単な解決策を提供できれば、私は非常に感謝しています!