(function ($){ $.fn.queueFn = function (c){ var b, d, a = Array.prototype.slice.call(arguments, 1); if (typeof c === "boolean") { if (c) { d = this; b = _AN_Read_length("length", this); } c = a.shift(); } c = $.isFunction(c)? c: $.fn[c]; return this.queue(function (){ !--b && c.apply(d || this, a); $.dequeue(this); } ); } ; } )(jQuery);