queue([queueName], newQueue)
version 1.2 以降
解説
マッチした要素のキューを、指定されたキューで置き換えます。
引数
-
[queueName]オプション
String: キューの名前。指定しない場合は、デフォルトの fx キューを置き換えます。
-
newQueue
Array<Function>: 置き換える関数の配列
戻り値
例
例1:アニメーションが実行される毎に、キュー内の関数の数を表示します。
$("#test1_run").click(function(){
$("#test1 .block")
.animate({height: "0px", opacity: 0.2}, 1500, showQueueLength)
.animate({height: "200px", opacity: 1.0}, 2000, showQueueLength)
.animate({fontSize: "2.0em"}, 1500, showQueueLength)
.animate({width: "150px"}, 1500, showQueueLength)
.animate({fontSize: "1.0em"}, 1500, showQueueLength)
.animate({width: "100px"}, 2000, showQueueLength)
showQueueLength();
});
function showQueueLength(){
$("#count").text($("#test1 .block").queue().length);
};
$("#test1_clear").click(function(){
$("#test1 .block")
.queue([])
.stop();
showQueueLength();
});
|