jQuery finish()メソッド

❮jQueryエフェクトメソッド

現在実行中のアニメーションを終了します。

$("#complete").click(function(){
  $("div").finish();
});

定義と使用法

finish()メソッドは、現在実行中のアニメーションを停止し、キューに入れられたすべてのアニメーションを削除して、選択した要素のすべてのアニメーションを完了します。

このメソッドは.stop(true、true)メソッドに似ていますが、finish()によってキューに入れられたすべてのアニメーションのCSSプロパティも停止する点が異なります。


構文

$(selector).finish(queueName)

Parameter Description
queueName Optional. Specifies the name of the queue to stop animations

❮jQueryエフェクトメソッド