Skip to content

Instantly share code, notes, and snippets.

@dominicgan
Created July 25, 2016 06:46
Show Gist options
  • Save dominicgan/5fa5299aa6986bf0d5ab47e69341df4d to your computer and use it in GitHub Desktop.
Save dominicgan/5fa5299aa6986bf0d5ab47e69341df4d to your computer and use it in GitHub Desktop.
Initialize flickity
var slider = document.querySelector('#slider');
imagesLoaded(slider, function() {
// load flickity only when images have all loaded
var flkty = new Flickity( slider, {
cellAlign: 'left',
contain: true,
prevNextButtons: false,
pageDots: false,
autoPlay: 2000,
wrapAround: true,
selectedAttraction: 0.01,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment