stop([clearQueue], [jumpToEnd])


version 1.2 以降

解説

実行中のアニメーションを停止します。
次のアニメーションがキューにある場合は即座に実行します。

引数

  • [clearQueue]オプション
    Boolean: trueを指定すると、キューにあるアニメーションを削除します。
  • [jumpToEnd]オプション
    Boolean: trueを指定すると、キューにあるアニメーションを実行した最終の状態にします。

戻り値

  • jQuery: jQueryオブジェクト

例1:停止ボタンを押すと、実行中のアニメーションを停止します。次のアニメーションがキューにあればすぐに実行します。

// アニメーション
$("#test1_run").click(function(){
    $("#test1 .block")
        .animate({height:   "0px",   opacity: 0.2}, 1500, "linear")
        .animate({height:   "200px", opacity: 1.0}, 2000, "swing")
        .animate({fontSize: "2.0em"}, 1500)
        .animate({width:    "150px"}, 1500)
        .animate({fontSize: "1.0em"}, 1500)
        .animate({width:    "100px"}, 2000);
});

// 実行中のアニメーションを停止して、次のアニメーションがキューにあれば実行
$("#test1_stop").click(function(){
    $("#test1 .block").stop();
});

テスト1

.block