queue([queueName], callback)
version 1.2 以降
解説
マッチした要素のキューの末尾に、指定された関数を追加します。
概念図
引数
-
[queueName]オプション
String: キューの名前。指定しない場合は、デフォルトの fx キューに追加します。
-
callback
Function: キューに追加する関数
戻り値
例
例1:アニメーション毎に"green" クラスを切り替えて色が変わるように、キューに登録します。
$("#test1_run").click(function(){
$("#test1 .block")
.animate({height: "hide", opacity: 0.2}, 1500, "linear")
.queue(function(){
$(this)
.toggleClass("green")
.dequeue();
})
.animate({height: "show", opacity: 1.0}, 2000, "swing");
});
|