Skip to content

Instantly share code, notes, and snippets.

@raybellis
Created October 2, 2012 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raybellis/3816885 to your computer and use it in GitHub Desktop.
Save raybellis/3816885 to your computer and use it in GitHub Desktop.
A jQuery plugin to allow any function to be queued (default 'fx' queue only)
(function($) {
$.fn.queued = function() {
var self = this;
var func = arguments[0];
var args = [].slice.call(arguments, 1);
return this.queue(function() {
$.fn[func].apply(self, args).dequeue();
});
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment