question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Synced slider with all slides shown does not advance "current"

See original GitHub issue

EDIT: 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">&larr;</div>',
    nextArrow: '<div class="arrow feat-next">&rarr;</div>',
    slide: '.featured-slide',
    asNavFor: '.slider-nav',
    fade: true,
    autoplay: true,
});

$('.slider-nav').slick({
    slidesToShow: 4,
    prevArrow: '<div class="arrow feat-prev">&larr;</div>',
    nextArrow: '<div class="arrow feat-next">&rarr;</div>',
    slide: '.slide-link',
    asNavFor: '.slider',
    arrows: false,
    focusOnSelect: true
});

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
kenwheelercommented, Aug 6, 2015

After reviewing the JSFiddle, there is a very simple fix that can be applied using the existing API. https://jsfiddle.net/b3kzaod9/3/

1reaction
athanphcommented, Aug 5, 2015

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

slick slider - syncing autoplay and active navigation
the dm4web answer is perfect if you are showing all the slides you have in your nav slider. If you have more slides...
Read more >
Why are slides not automatically advancing?
Navigate to Edit mode of the presentation; Select the Options tab; Un-check "User must click 'play' to advance" at the bottom of the...
Read more >
Share slides in a Teams meeting with PowerPoint Live
Navigate through the slides · Use the navigation arrows to go forward and backward. · Use the thumbnail strip to jump ahead or...
Read more >
Slide videos - Adobe Support
Learn how to insert, edit, synchronize, manage, and update slide videos in Adobe Captivate.
Read more >
Sliders | Themeco Docs
If set to Slide, the content will only move by one Slide at a time, no matter the layout (for example, you could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found