Skip to content

Instantly share code, notes, and snippets.

@kangax
Created October 28, 2008 14:27
Show Gist options
  • Save kangax/20391 to your computer and use it in GitHub Desktop.
Save kangax/20391 to your computer and use it in GitHub Desktop.
;jQuery.fn.extend({
// Andrea Giammarchi - Mit Style Licence - V0.2
If: (jQuery.fn.ElseIf = function(fn){
var __If__ = this.__If__ || this,
$ = __If__.filter(fn);
$.__If__ = __If__.filter(function(){return !~$.index(this)});
return $;
}),
Else:function(){
return this.__If__;
},
Do:jQuery.fn.each
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment