Slick sync sliders out of sync by 1 item each time
See original GitHub issueI’m trying to achieve a history / timeline effect using two Slick sliders using the sync function. I have everything setup and it seems to work except the second slider (the ‘navigation’) doesn’t work as in it’s one slide behind what is on the left slide.
There are four years, 1999, 2001, 2002 and 2005. It’s almost as if the slider directions are reversed for some reason. When you load the page, the nav starts on 1999 but on the left, the main content slider starts on 2005.
Example image…
The HTML markup…
<!-- ko if: hasItems() -->
<div class="listings-list__items history-timeline-data" data-bind="foreach: items">
<div class="history-entry">
<img class="history-entry__image" data-bind="attr: { src: $data.PrimaryImageUrl }" />
<div class="history-entry__content">
<div class="history-entry__content-year" data-bind="text: Year"></div>
<div class="history-entry__content-name" data-bind="text: Name"></div>
<div class="history-entry__content-text" data-bind="text: Text"></div>
</div>
</div>
</div>
<!-- /ko -->
<!-- ko if: hasItems() -->
<div class="listings-list__items history-timeline-nav" data-bind="foreach: items">
<div class="history-entry">
<div class="history-nav-link" data-bind="text: Year"></div>
</div>
</div>
<!-- /ko -->
The jQuery/Slick markup…
// Initialise the Slick slider
$(".history-timeline-data").slick({
slidesToShow: 1,
slidesToScroll: 1,
vertical: true,
centerMode: true,
centerPadding: "0px",
autoplay: false,
infinite: true,
arrows: false,
swipe: true,
verticalSwiping: true,
asNavFor: ".history-timeline-nav"
}), $(".history-timeline-nav").slick({
slidesToShow: 8,
slidesToScroll: 1,
vertical: true,
centerMode: true,
centerPadding: "0px",
autoplay: false,
infinite: true,
arrows: true,
swipe: false,
verticalSwiping: true,
asNavFor: ".history-timeline-data"
});
Steps to reproduce the problem
- Set up slider sync with two sliders
- Load the page up and slide through one of the sliders
What is the expected behaviour?
Both sliders to be in sync
What is observed behaviour?
The sliders are out of sync by 1.
More Details
- Chrome v53 stable channel
- Not sure, minified in system packages (latest?)
- I don’t think so no
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Multiple Slick Sliders Issue - Stack Overflow
js plugin with its Slider Syncing feature. The issue I am having is that if I use multiple sliders on a single page,...
Read more >WP Slick Slider and Image Carousel – WordPress plugin
A quick, easy way to add and display multiple WP Slick Slider and carousel using a shortcode. Also added Gutenberg block support.
Read more >Can't manage to synchronise two Slick Carousel ... - Drupal
Hello everyone, My main goal is to have a Slider Syncing on my work ... I have two Slick Carousel, created by the...
Read more >Splide - The lightweight, flexible and accessible slider/carousel
Splide is a lightweight, flexible and accessible slider/carousel, ... 1 Slide Per Move ... Splide sliders can be synchronized with one another.
Read more >slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, ... slidesToShow: 1, slidesToScroll: 1 } } // You can unslick at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well not so much support, but I found out the issue. It seems to be a bug with some options I had set.
Using both
vertical
andcenterMode
together as true causes the second slider to skip ahead by one. When I took center mode out of the settings (essentially false), it worked fine again. So not much of an issue for me due to the setup, but definitely a bug, that’s for sure.Hah, sorry: test* case