Skip to content

Instantly share code, notes, and snippets.

@briansw
Created January 30, 2017 18:31
Show Gist options
  • Save briansw/085c017fbc4d2feeeb024af859b378ef to your computer and use it in GitHub Desktop.
Save briansw/085c017fbc4d2feeeb024af859b378ef to your computer and use it in GitHub Desktop.
$('.slides').on('beforeChange', function(event, slick, currentSlide, nextSlide) {
var caption = $($('.slide')[nextSlide + 1]).data('caption');
$('.footer .caption').html(caption);
});
$('.slides').on('init', function(event, slick) {
var caption = $($('.slide')[1]).data('caption');
$('.footer .caption').html(caption);
});
init_slick();
function init_slick() {
$('.lightbox .slides').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: false,
autoplaySpeed: 2000,
arrows: true,
dots: false,
infinite: true,
speed: 700,
pauseOnHover: false,
swipe: true,
accessibility: false
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment