Example 1 — Official: Show Queue Length
Read the fx queue array and print .length.
$("#box").fadeOut(800).fadeIn(800).fadeOut(800);
var n = jQuery.queue($("#box")[0], "fx");
console.log("Queue length is: " + n.length); How It Works
- Enqueue. Each fade call adds a step to the
fxqueue. - Inspect.
jQuery.queue(el, "fx")returns the pending array. - Length.
n.lengthis how many steps are still waiting or in flight.

