Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metafizzy/flickity
:leaves: Touch, responsive, flickable carousels
https://github.com/metafizzy/flickity
Last synced: 5 days ago
JSON representation
:leaves: Touch, responsive, flickable carousels
- Host: GitHub
- URL: https://github.com/metafizzy/flickity
- Owner: metafizzy
- Created: 2014-12-15T22:30:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T18:19:44.000Z (7 months ago)
- Last Synced: 2024-12-04T12:06:06.790Z (10 days ago)
- Language: JavaScript
- Homepage: https://flickity.metafizzy.co
- Size: 1.64 MB
- Stars: 7,545
- Watchers: 127
- Forks: 601
- Open Issues: 119
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
Awesome Lists containing this project
- awesome-javascript - flickity - Touch, responsive, flickable carousels - ★ 5054 (Sliders)
- awesome-frontend-libraries - flickity
README
# Flickity
_Touch, responsive, flickable carousels_
See [flickity.metafizzy.co](https://flickity.metafizzy.co) for complete docs and demos.
## Install
### Download
+ CSS:
- [flickity.min.css](https://unpkg.com/flickity@2/dist/flickity.min.css) minified, or
- [flickity.css](https://unpkg.com/flickity@2/dist/flickity.css) un-minified
+ JavaScript:
- [flickity.pkgd.min.js](https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js) minified, or
- [flickity.pkgd.js](https://unpkg.com/flickity@2/dist/flickity.pkgd.js) un-minified### CDN
Link directly to Flickity files on [unpkg](https://unpkg.com).
``` html
```
``` html
```
### Package managers
Bower: `bower install flickity --save`
npm: `npm install flickity --save`
## License
### Commercial license
If you want to use Flickity to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Purchase a Flickity Commercial License at [flickity.metafizzy.co](https://flickity.metafizzy.co/#commercial-license)
### Open source license
If you are creating an open source application under a license compatible with the [GNU GPL license v3](https://www.gnu.org/licenses/gpl-3.0.html), you may use Flickity under the terms of the GPLv3.
[Read more about Flickity's license](https://flickity.metafizzy.co/license.html).
## Usage
Flickity works with a container element and a set of child cell elements
``` html
...
...
...
...
```### Options
``` js
var flky = new Flickity( '.gallery', {
// options, defaults listedaccessibility: true,
// enable keyboard navigation, pressing left & right keysadaptiveHeight: false,
// set carousel height to the selected slideautoPlay: false,
// advances to the next cell
// if true, default is 3 seconds
// or set time between advances in milliseconds
// i.e. `autoPlay: 1000` will advance every 1 secondcellAlign: 'center',
// alignment of cells, 'center', 'left', or 'right'
// or a decimal 0-1, 0 is beginning (left) of container, 1 is end (right)cellSelector: undefined,
// specify selector for cell elementscontain: false,
// will contain cells to container
// so no excess scroll at beginning or end
// has no effect if wrapAround is enableddraggable: '>1',
// enables dragging & flicking
// if at least 2 cellsdragThreshold: 3,
// number of pixels a user must scroll horizontally to start dragging
// increase to allow more room for vertical scroll for touch devicesfreeScroll: false,
// enables content to be freely scrolled and flicked
// without aligning cellsfriction: 0.2,
// smaller number = easier to flick farthergroupCells: false,
// group cells together in slidesinitialIndex: 0,
// zero-based index of the initial selected celllazyLoad: true,
// enable lazy-loading images
// set img data-flickity-lazyload="src.jpg"
// set to number to load images adjacent cellspercentPosition: true,
// sets positioning in percent values, rather than pixels
// Enable if items have percent widths
// Disable if items have pixel widths, like imagesprevNextButtons: true,
// creates and enables buttons to click to previous & next cellspageDots: true,
// create and enable page dotsresize: true,
// listens to window resize events to adjust size & positionsrightToLeft: false,
// enables right-to-left layoutsetGallerySize: true,
// sets the height of gallery
// disable if gallery already has height set with CSSwatchCSS: false,
// watches the content of :after of the element
// activates if #element:after { content: 'flickity' }wrapAround: false
// at end of cells, wraps-around to first for infinite scrolling});
```---
By [Metafizzy 🌈🐻](https://metafizzy.co)