Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created September 29, 2009 17:38
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 cowboy/197071 to your computer and use it in GitHub Desktop.
Save cowboy/197071 to your computer and use it in GitHub Desktop.
// This has moved! Get it here:
// http://github.com/cowboy/jquery-misc/blob/master/jquery.ba-nextUntil.js
jQuery.fn.nextUntil = function( expr ) {
var elems = [];
this.nextAll().each(function(){
return jQuery(this).is( expr )
? false
: elems.push( this );
});
return this.pushStack( elems, 'nextUntil', expr );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment