Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Swipe component with touch support (for image carousels, dynamic content etc)
HTML JavaScript Makefile

This branch is even with gh-pages

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
build.css
build.js
component.json
index.html
index.js

Readme.md

swipe

Carousel component with touch / swipe support.

Installation

$ component install component/carousel

API

Carousel(el)

Create a carousel for el. This should be a container element that wraps a list of several items. View ./example.html for a working example.

.duration(ms)

Set the transition duration, defaults to 300ms.

.interval(ms)

Set the cycle interval, defaults to 5000ms.

.play()

Play through all items using the cycle interval.

.stop()

Stop playing.

.isFirst()

Is on the first item.

.isLast()

Is on the last item.

.prev()

Show the previous item if present, or do nothing.

.next()

Show the next item if present, or do nothing.

.show(i, [ms])

Show item with the given index i with the given transition in ms defaulting to the .duration() value.

License

MIT

Something went wrong with that request. Please try again.