Created
October 1, 2012 20:05
-
-
Save jasonkuhrt/3814100 to your computer and use it in GitHub Desktop.
Helper function to select next sibling or farthest left i.e. parent's first-child (this is helpful for looping galleries, etc.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.next-or-first = -> | |
$next = @next! | |
if not empty $next then $next else @parent!children!first! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment