I am using Slick Slider but have a few slides which are marked as hidden dynamically.
My issue is that Slick Slicker still assigns an index to the hidden slides as if they are visible, and in Center Mode this affects the centering of the slides. In my case, I have 3 slides always visible (left, center, right). If I select the slide after a hidden slide, it appears in the left position as oppose to the center position due to Slick Slider thinking that the hidden slide is taking up width.
Is there a way to have Slick Slider ignore hidden slides on initialization? Or at least get the center mode alignment to work when dealing with hidden slides.
jq('.slider').slick({
prevArrow: '<div class="slick-prev"><i class="fa fa-angle-left" aria-hidden="true"></i></div>',
nextArrow: '<div class="slick-next"><i class="fa fa-angle-right" aria-hidden="true"></i></div>',
infinite: false,
slidesToShow: 3,
slidesToScroll: 1,
focusOnSelect: true,
centerMode: true,
centerPadding: 0
});
To hide slides I am simple using display:none;