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.

Hot! Slick centerMode infinite slickGoTo Bug

See original GitHub issue

Hi, I need an advice! I change slides by click on the image previews on the carousel.

Demonstration: https://jsfiddle.net/er712r5z/4/

With 5 visible slides doesn’t work clicking on -2 index slide when 0 slide is active! But -1 slide click works fine and if I go to 1,2,3 and other slides, -2 index click slide works fine (ever click on the left slide). How do I need to correct my code to work negative -2 index?

`$(“#setSlider .setSliderListOneImage”).click(function(){ var index = $(this).parent().data(“slick-index”); $(“.setSliderList”).slick(“slickGoTo”,index); });

$('.setSliderList').slick({
    autoplay:false,
    infinite: true,
    arrows:true,
    dots: true,
    speed: 600,
    slidesToShow: 5,
    swipe: false,
    centerMode: true,
    initialSlide: 0,
    responsive: [
        {
            breakpoint: 1400,
            settings: {
                slidesToShow: 3
            }
        },{
            breakpoint: 768,
            settings: {
                slidesToShow: 1
            }
        }
    ]
});`

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
giacomocarracommented, Jan 21, 2019

This bug is still present in the latest version (1.9.0). I have not found any other issue that talks about this. Has anyone found a solution?

Found a solution! Adding “focusOnSelect: true” fix the bug. This il my initialization:

$('.selettore--track').slick({ centerMode: true, centerPadding: '0px', slidesToShow: 5, infinite: true, initialSlide: 0, focusOnSelect: true

Hope this will help someone. I’m using slick 1.9.0 and jquery 3.3.1

0reactions
giacomocarracommented, Jan 21, 2019

This bug is still present in the latest version (1.9.0). I have not found any other issue that talks about this. Has anyone found a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

slick slider - css transition infinite loop bug - Stack Overflow
Solution 1 - Use Flickity. If you want to try another carousel control, you can have a look at Flickity. According to my...
Read more >
slick slider white space
When using center mode and infinite false with variable width you get extra white space at first slide left side and last slide...
Read more >
kenwheeler / slick the last carousel... - Course Hero
IfremoveBefore is set to false, remove theslide following index, or the last slide if noindex is set.slickFilterfilter : selectoror functionFilters slides using ...
Read more >
slick slider js Code Example
('.responsive').slick({ dots: true, infinite: false, speed: 300, slidesToShow: 4, slidesToScroll: 4, responsive: [ { breakpoint: 1024, ...
Read more >
Angular Slick Carousel 1 (forked) - StackBlitz
import 'slick-carousel/slick/slick.js' ... centerMode: true,. centerPadding: '60px',. slidesToShow: 3,. vertical: true,. infinite: true,.
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