-
-
Save cowboy/36f3be40777bd70706b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery queueFn - v0.7pre - 9/02/2010 | |
* http://benalman.com/projects/jquery-misc-plugins/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($,undefined){ | |
'$:nomunge'; // Used by YUI compressor. | |
$.fn.queueFn = function( once, fn ) { | |
var that = this, | |
args, | |
args_to_slice = 2, | |
i = that.length; | |
if ( typeof once !== 'boolean' ) { | |
fn = once; | |
once = undefined; | |
args_to_slice = 1; | |
} | |
args = Array.prototype.slice.call( arguments, args_to_slice ); | |
fn = $.isFunction( fn ) ? fn : $.fn[ fn ]; | |
return that.queue(function(){ | |
( !once || !--i ) && fn.apply( once ? that : this, args ); | |
$.dequeue( this ); | |
}); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment