jQuery.iff
http://benalman.com/code/javascript/jquery/jquery.ba-iff.js
/*!
* iff - v0.2 - 6/3/2009
* http://benalman.com/projects/jquery-iff-plugin/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
* Licensed under the MIT license
* http://benalman.com/about/license/
*/
(function($){
'$:nomunge'; // Used by YUI compressor.
$.fn.iff = function( test ) {
var elems = !test || $.isFunction( test )
&& !test.apply( this, Array.prototype.slice.call(arguments, 1) )
? []
: this;
return this.pushStack( elems, 'iff', test );
};
})(jQuery);
//---- yui
/*
* iff - v0.2 - 6/3/2009
* http://benalman.com/projects/jquery-iff-plugin/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
* Licensed under the MIT license
* http://benalman.com/about/license/
*/
(function($){$.fn.iff=function(b){var a=!b||$.isFunction(b)&&!b.apply(this,Array.prototype.slice.call(arguments,1))?[]:this;return this.pushStack(a,"iff",b)}})(jQuery);