Skip to content

Instantly share code, notes, and snippets.

@markhowellsmead
Last active January 18, 2019 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markhowellsmead/6c3414386ab91ffc74ae994927766772 to your computer and use it in GitHub Desktop.
Save markhowellsmead/6c3414386ab91ffc74ae994927766772 to your computer and use it in GitHub Desktop.
Say Hello: Carousel using Flickity, Timber and Twig, with custom cross-fade effect
.flickity {
&--fade {
.flickity-slider {
transform: none !important;
}
.flickity-cell {
@include transition(all, slower);
left: 0 !important;
opacity: 0;
z-index: -1;
}
.flickity-cell.is-selected {
opacity: 1;
z-index: 0
}
}
}
(function($) {
$('[data-carousel="fade"]').flickity({
autoPlay: 5000,
cellSelector: '.flickity-cell',
draggable: false,
pageDots: false,
prevNextButtons: false
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment