Infinite: true not looping correctly
See original GitHub issueGiven a slider with 10 items, slidesToShow = 5, slidesToScroll = 3, and infinite = true, When I reach the end of the slider (viewing items 07 08 09 10 01) When I click the “Next” arrow I see items 06 07 08 09 10 instead of items 10 01 02 03 04
[ http://jsfiddle.net/n195kyfz/ ]
Steps to reproduce the problem
- Create a slider with 10 items
- Set slidesToShow to 5 and slidesToScroll to 3 (main setting)
- Set slidesToShow to 3 and slidesToScroll to 2 (responsive, breakpoint 850)
- Set slidesToShow to 2 and slidesToScroll to 1 (responsive, breakpoint 425)
- Load in a viewport > 850px wide
- Click the next arrow 3 times
What is the expected behaviour?
Page load shows items: 01 02 03 04 05
“Next” Click 1 shows items: 04 05 06 07 08
“Next” Click 2 shows items: 07 08 09 10 01
“Next” Click 3 shows items (expected): 10 01 02 03 04
What is observed behaviour?
Page load shows items: 01 02 03 04 05
“Next” Click 1 shows items: 04 05 06 07 08
“Next” Click 2 shows items: 07 08 09 10 01
“Next” Click 3 shows items (actual): 06 07 08 09 10
More Details
- Which browsers/versions does it happen on? Firefox, Chrome, possibly others. Only happening on desktop but might have to do with my responsive slidesToShow/Scroll settings.
- Which jQuery/Slick version are you using? jquery-rails (~> 3.1.2), Slick Version: 1.4.1
- Did this work before? Unknown, haven’t tried a multi-item infinite carousel before
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:10
Top Results From Across the Web
Slick slider not looping correctly - Stack Overflow
Slick slider not looping correctly ... It is infinite: true by default, but adding it in makes no difference.
Read more >Infinite loops and break · CodeCraft-Python - BuzzCoder
Having the condition in your while loop always be True isn't necessarily bad in some situations. Sometimes these loops can simplify program logic...
Read more >[Resolved] My 'While Loop' is Infinite HELP - Codecademy
Initialize two variables, i and getToDaChoppa. i is a boolean value 'True', while getToDaChoppa is a function. When getToDaChoppa is called, the following...
Read more >Is while true an infinite loop? - Quora
In common parlance, yes, though “Infinite” is a bit of a misnomer. Unless true is reserved, read only or constant, you can just...
Read more >Intentional Infinite Loops - Incremental Java
An infinite loop occurs when a condition always evaluates to true. Usually, this is an error. For example, you might have a loop...
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
Strange 3+ yrs still no solution
using this worked