Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/poppa/carousel-js
A simple Javascript carousel with no library dependency and lazy image loading
https://github.com/poppa/carousel-js
carousel javascript-carousel
Last synced: 12 days ago
JSON representation
A simple Javascript carousel with no library dependency and lazy image loading
- Host: GitHub
- URL: https://github.com/poppa/carousel-js
- Owner: poppa
- License: mit
- Created: 2016-11-17T22:24:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T14:57:32.000Z (almost 2 years ago)
- Last Synced: 2024-11-04T03:41:26.679Z (2 months ago)
- Topics: carousel, javascript-carousel
- Language: HTML
- Size: 2.03 MB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Carousel.JS
A simple Javascript carousel with no library dependencies, with lazy image loading and support for multiple image sources for the same item depending on device size.
This is not a fancy pancy full fledged carousel in any way, and that will never
be the purpose or goal either. If that's what you want then check out [Slick](http://kenwheeler.github.io/slick/) instead.For real examples check out the [Carousel.JS](https://poppa.github.io/carousel-js/)
web page.---
## Howto
The size of the carousel is determined by the size of its outer container. This means
that the carousel wrapper must have a given height in some way.---
### Carousel wrapper
The outer most `div` element of the carousel that contain all carousel content
```html
```| Attribute | Description | Example |
| -------------------------------- | -------------------------------------------- | -------- |
| `data-carousel-delay` | Delay in milliseconds between rotations | 10000 |
| `data-carousel-indicators` | Add indicators | No value |
| `data-carousel-touch-threshold` | x distance to swipe before transition starts. Can be either a fixed number (px) or in percent (%) | 100 or 50% |
| `data-carousel-rubberband-swipe` | Give a rubber band effect when swipeing. | 1.5 |
| `data-carousel-wrapper` | CSS selector for the outer wrapper. Only used when `data-carousel-keep-img` and `data-carousel-auto-height` are used | .outer-wrapper |
---### Carousel slider
This is the first child of the **Carousel wrapper**. This element takes no data attributes
```html