queue([queueName])
version 1.2 以降
解説
マッチした要素のキューを返します。
概念図
引数
-
[queueName]オプション
String: キューの名前。指定しない場合は、デフォルトの fx キューを返します。
戻り値
-
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);
};
|