• Stars
    star
    7,469
  • Rank 4,878 (Top 0.1 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍃 Touch, responsive, flickable carousels

Flickity

Touch, responsive, flickable carousels

See flickity.metafizzy.co for complete docs and demos.

Install

Download

CDN

Link directly to Flickity files on unpkg.

<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">
<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>

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

Open source license

If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use Flickity under the terms of the GPLv3.

Read more about Flickity's license.

Usage

Flickity works with a container element and a set of child cell elements

<div class="carousel">
  <div class="carousel-cell">...</div>
  <div class="carousel-cell">...</div>
  <div class="carousel-cell">...</div>
  ...
</div>

Options

var flky = new Flickity( '.gallery', {
  // options, defaults listed

  accessibility: true,
  // enable keyboard navigation, pressing left & right keys

  adaptiveHeight: false,
  // set carousel height to the selected slide

  autoPlay: 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 second

  cellAlign: '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 elements

  contain: false,
  // will contain cells to container
  // so no excess scroll at beginning or end
  // has no effect if wrapAround is enabled

  draggable: '>1',
  // enables dragging & flicking
  // if at least 2 cells

  dragThreshold: 3,
  // number of pixels a user must scroll horizontally to start dragging
  // increase to allow more room for vertical scroll for touch devices

  freeScroll: false,
  // enables content to be freely scrolled and flicked
  // without aligning cells

  friction: 0.2,
  // smaller number = easier to flick farther

  groupCells: false,
  // group cells together in slides

  initialIndex: 0,
  // zero-based index of the initial selected cell

  lazyLoad: true,
  // enable lazy-loading images
  // set img data-flickity-lazyload="src.jpg"
  // set to number to load images adjacent cells

  percentPosition: true,
  // sets positioning in percent values, rather than pixels
  // Enable if items have percent widths
  // Disable if items have pixel widths, like images

  prevNextButtons: true,
  // creates and enables buttons to click to previous & next cells

  pageDots: true,
  // create and enable page dots

  resize: true,
  // listens to window resize events to adjust size & positions

  rightToLeft: false,
  // enables right-to-left layout

  setGallerySize: true,
  // sets the height of gallery
  // disable if gallery already has height set with CSS

  watchCSS: 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 🌈🐻

More Repositories

1

isotope

💞 Filter & sort magical layouts
HTML
10,984
star
2

zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
JavaScript
10,208
star
3

infinite-scroll

📜 Automatically add next page
HTML
7,378
star
4

packery

🍱 Gapless, draggable grid layouts
JavaScript
4,081
star
5

huebee

🐝 1-click color picker
JavaScript
395
star
6

outlayer

👷 the brains & guts of a layout library
JavaScript
162
star
7

unidragger

👇 Draggable base class
JavaScript
82
star
8

ev-emitter

🔔 Lil' event emitter
JavaScript
66
star
9

flickity-fade

Fade between Flickity slides
JavaScript
62
star
10

zdog-demos

Round, flat, designer friendly demos for Zdog
Makefile
54
star
11

fizzy-ui-utils

UI utilities & helpers
JavaScript
47
star
12

flickity-fullscreen

Enable fullscreen view for Flickity carousels
HTML
44
star
13

tap-listener

Listens to taps
JavaScript
42
star
14

isotope-packery

packery layout mode for Isotope
JavaScript
42
star
15

flickity-bg-lazyload

Flickity lazyload background images
HTML
31
star
16

flickity-as-nav-for

Enable asNavFor for Flickity
HTML
30
star
17

metafizzy.co

🐻 Metafizzy site!
Handlebars
29
star
18

flickity-sync

Sync up two Flickity carousels
HTML
28
star
19

flickity-docs

📝 documentation for Flickity
Handlebars
28
star
20

unipointer

☝️ Do one thing with one pointer
JavaScript
27
star
21

flickity-imagesloaded

enables imagesLoaded option for Flickity
JavaScript
20
star
22

zdog-docs

Documentation site for Zdog
Handlebars
18
star
23

fizzy.school

🎃 Lessons for anyone writing jQuery
HTML
17
star
24

logo.pizza

🍕 Logo Pizza site
JavaScript
16
star
25

next-project

Help us decide what to build next
16
star
26

isotope-docs

📝 documentation for Isotope
Handlebars
13
star
27

isotope-masonry-horizontal

masonryHorizontal layout mode for Isotope
HTML
13
star
28

flickity-hash

Select Flickity slides with links
HTML
11
star
29

droppabilly

Drag and drop
JavaScript
10
star
30

packery-docs

📝 Documentation for Packery
HTML
9
star
31

isotope-fit-columns

fitColumns layout mode for Isotope
JavaScript
7
star
32

isotope-horizontal

horizontal layout mode for Isotope
JavaScript
7
star
33

eslint-plugin-metafizzy

ESLint config and rules for Metafizzy
JavaScript
3
star
34

transfob

get a transform stream, like through2.obj()
JavaScript
3
star
35

isotope-cells-by-column

cellsByColumn layout mode for Isotope
JavaScript
3
star
36

flickity-dev

Little demos made in development of Flickity
JavaScript
3
star
37

fizzy-docs-modules

Modules used in Metafizzy documentation sites
Handlebars
3
star
38

isotope-cells-by-row

cellsByRow layout mode for Isotope
JavaScript
2
star
39

huebee-docs

Huebee documentation
Handlebars
2
star
40

grunt-fizzy-docs

Grunt tasks for Masonry, Isotope, and Packery docs
JavaScript
2
star
41

infinite-scroll-docs

📝 Documentation for Infinite Scroll
Handlebars
2
star