Skip to content

Instantly share code, notes, and snippets.

@joelremix
Last active August 29, 2015 14:02
Show Gist options
  • 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