Skip to content

Conversation

@Netopya
Copy link

@Netopya Netopya commented Sep 6, 2019

When infinite is enabled, the loop that generates the cloned slides to be appended to the end of the track iterates over too many slides. In fact it iterates beyond the number of slides but jQuery fails silently once it exceeds the slides. The result is that too many slides get cloned and appended to the end of the track. This previously caused issues fixed with [#3809]. This remaining fix cleans up the DOM by trimming out the cloned slides that are never visible.

Original Issue:
http://jsfiddle.net/MrCroissant1/xrgkL8nu/4/

Screenshot at Sep 06 17-29-55
Notice how all the slides from the slider are cloned as the end of the track

With fix:
http://jsfiddle.net/MrCroissant1/79yunkeq/1/

Screenshot at Sep 06 17-43-02
Notice how only the first slide is cloned at the end of the slide, which is all we need since slidesToShow is just 1.

This for loop iterates over too many slides. In fact it iterates beyond the number of slides but jQuery fails silently once it exceeds the slides. The result is that too many slides get cloned and appended to the end of the track. This previously caused issues fixed with [kenwheeler#3809]. This remaining fix is a minor performance improvement by trimming out the cloned slides that are never visible.
@Netopya Netopya changed the title [kenwheeler/slick#3691] Fix extra cloned slides [#3691] Fix extra cloned slides Sep 6, 2019
@Netopya Netopya changed the title [#3691] Fix extra cloned slides Fix extra cloned slides [Fixes #3691] Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant