整個問題是,我有一個頭是固定的,並有一個div下,我需要相應地移動。雖然如果我點擊的速度真的很快,例如3到4倍的動畫混亂,我最終會在內容中包含「下」div。我在動畫和滑動之前使用停止。我嘗試使用隊列等無效。與動畫jQuery重疊問題
$(".header").click(function() {
$header = $(this);
$content = $header.next();
$content.stop().slideToggle(500, function() {
if(($('.lol').css('margin-top')) == '47px')
{
$(".under").stop().animate({'margin-top': "100px"}, 500)
}
else
{
$(".under").stop().animate({'margin-top': "47px"}, 500)
}
});
});
https://jsfiddle.net/zddzvxLy/8/
這裏的jsfiddle顯示的問題。試着點擊表頭幾次實在是快,「這必須是「會出現內部CONTENT下
對不起,我想一切從笑改爲下這樣的代碼會更容易理解和錯過了一個。無論如何,停止(真實,真實)並不能解決問題。 – Argus
在我的示例中(小提琴的修訂版本10),問題不再存在。 – Dutchie432
看起來問題已解決。謝謝。只要它允許我接受這個答案。 我檢查了停止的文件,現在變得清楚了。 .stop([clearQueue] [,jumpToEnd]) 謝謝! – Argus