I'd like to know if there is any way to pass new options to already created Slick carousel? I have this code:
$('.bottom-slider').slick({
asNavFor: '.top-slider',
slidesToShow: 3,
slidesToScroll: 1,
variableWidth: true,
centerMode: true,
etc...
});
and at some moment (added CSS class to restyle slider) I'd like to pass slidesToShow: 5
to carousel. I tried with
$('.bottom-slider').slick({slidesToShow: 5});
but it doesn't work. Is it possible? I prefer not to destroy/run again slider or create second box with "restyled" carousel.
I found the description of slickSetOption
on the website to be a bit confusing, so leaving a couple examples here.
Set single option without UI refresh:
$('.initialized-carousel').slick('slickSetOption', 'slidesToShow', 3);
Set multiple options with UI refresh:
$('.initialized-carousel').slick('slickSetOption', {
slidesToShow: 3,
slidesToScroll: 1
}, true);