Synced slider with all slides shown does not advance "current"
See original GitHub issueEDIT: JSFiddle here
First of all, let me say - I love Slick. It’s amazing. On behalf of developers the world over, a big thank you to @kenwheeler.
However, I came across a problem in using it in one of the prescribed ways – leave it to me to find the one use case where some otherwise great thing doesn’t work. I’m utilizing the asNavFor setting between two sliders - one as a single (show/scroll 1) and one as an index (text-only). There are 4 slides total.
The intent is for the index to remain static with the exception of highlighting the current slide. However! It works appropriately except when all slides are shown in the nav. When all slides are set to be shown, clicking the nav advances the slider, but when the slider moves, the nav’s “slick-current” class toggle is not triggered. To be clear, it does work just fine when slidesToShow for the nav is set to anything below 4, and also correctly changes both sliders when the nav is clicked.
$('.slider').slick({
slidesToShow: 1,
prevArrow: '<div class="arrow feat-prev">←</div>',
nextArrow: '<div class="arrow feat-next">→</div>',
slide: '.featured-slide',
asNavFor: '.slider-nav',
fade: true,
autoplay: true,
});
$('.slider-nav').slick({
slidesToShow: 4,
prevArrow: '<div class="arrow feat-prev">←</div>',
nextArrow: '<div class="arrow feat-next">→</div>',
slide: '.slide-link',
asNavFor: '.slider',
arrows: false,
focusOnSelect: true
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (1 by maintainers)
Top GitHub Comments
After reviewing the JSFiddle, there is a very simple fix that can be applied using the existing API. https://jsfiddle.net/b3kzaod9/3/
Same thing here. Even if all thumbnails are not shown while infinite is disabled, “current” does not sync.
Sync “current” only happens when 1) ‘infinite’ is true and 2) ‘slidesToShow’ is less than the slide items.