vUX / Carousel / v4.1.0
Autoplay, dots, swipe and hover-pause from one constructor and two elements you already have.
Every config property, applied live to a running carousel. No rebuild is needed for any of
them; Destroy and Rebuild are here to show the teardown.
Each instance owns its dots and its buttonStyle. Click a dot on one and the other does not
notice; the styles are scoped to their own container.
With touchResponse on (the default) the carousel builds a TouchHandler on the
container. Drag with a mouse or a finger. Pointing at the frame pauses autoplay; leaving resumes it.
A drag past a quarter of the frame's width commits to the neighbouring slide;
anything shorter springs back. The first and last slides are end stops: swipes do not wrap,
autoplay does.
When the swipe settles, the carousel marks that slide active and lights its dot, so autoplay
continues from where your finger left it, not from where the timer thought it was.
While swiping is on, the container carries vTouchHandler, which gives it the grab cursor and
touch-action:pan-y, so on a phone a horizontal swipe is not taken over by page scrolling.
The constructor and every config setter validate on the spot and throw a message naming the
offending argument. These buttons do the wrong thing on purpose.