Created
September 16, 2013 11:24
-
-
Save technobulka/6579441 to your computer and use it in GitHub Desktop.
Next/prev list item by circle
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
var c = 9, // current, start from length-1 | |
l = 10, // length | |
i; // index, 0 - prev, 1 - next | |
c = i?++c%l:~--c%l?c%l:l-1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment