Skip to content

Instantly share code, notes, and snippets.

@joelremix
Last active August 29, 2015 14:02
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 joelremix/e03bce1f708583d73e98 to your computer and use it in GitHub Desktop.
Save joelremix/e03bce1f708583d73e98 to your computer and use it in GitHub Desktop.
jQuery: nextStep
$.fn.nextStep = function(step) {
elem = this.parent().children().eq(this.index() + step -1 -(this.index()%step));
return elem.length ? elem : this.parent().children().last();
};
http://stackoverflow.com/a/18444288/372567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment