$('.slider-for').each(function(key, item) {
var sliderIdName = 'slider' + key;
var sliderNavIdName = 'sliderNav' + key;
this.id = sliderIdName;
$('.slider-nav')[key].id = sliderNavIdName;
var sliderId = '#' + sliderIdName;
var sliderNavId = '#' + sliderNavIdName;
$(sliderId).slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: sliderNavId
});
$(sliderNavId).slick({
slidesToShow: 4,
slidesToScroll: 1,
asNavFor: sliderId,
dots: true,
arrows: true,
centerMode: false,
focusOnSelect: true
});
});
$(document).ready(function() {
var myCarousel = $(".slider-for:not(.slick-initialized)");
myCarousel.each(function() {
$(this).slick({});
});
});
$(function () {
$('.slider-for').each(function(num, elem) {
elem = $(elem);
elem.slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
draggable: false,
fade: true,
asNavFor: '.slider-nav'
});
elem.next('.slider-nav-thumbnails').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slider-for',
dots: false,
arrows: false,
vertical: true,
draggable: false,
centerMode: false,
focusOnSelect: true,
responsive: [
{
breakpoint: 769,
settings: {
vertical: false
}
}
]
});
});
});