Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は jQuery 用のスライド ショー アプリ (ボタンをクリックすると、画像のリストをスライドする) を作成している最中ですがclick()、アニメーションが実行されている間でも要求に応答するという小さなバグに遭遇しました。ハプニング。私はanimate()すでにこの関数を使用しているので、追加のアニメーション リクエストを回避することはできません。
click()
animate()
これを回避するためにプログラムする方法はありますか?
clickハンドラーでアニメーションが進行中かどうかを確認できます。
click
if ($(this).is(':animated')) return false;
あるいは、liveまたはdelegate関数を使用して、ハンドラーをアニメーション化されていない要素にのみバインドすることもできます。
live
delegate
$('something:not(:animated)').live('click', function() { ... });