jsor/jcarousel — Issue #277: 0.3 Circular Wrap with Indexes < 0
Author: efxviet
Created: 2011-11-29 19:22:07+00:00
State: open

I set up a circular carousel where the user can click on an item and the carousel scrolls so that the clicked item lands in a "highlighted" spot. Something like:

o o [ o ] o o

Where o's are images, and [ ] denotes the highlighted spot.

I do this by grabbing the index of the clicked one, subtracting 2 in this case, and passing that to carousel.scroll(). Scroll seems to do what I want and gets me the clicked item into the highlight spot, but for indexes less than zero, the carousel does kind of a slot-machine thing spins out of control first, instead of just sliding over one or two.

Is there another way I can achieve this?