ganlanyuan / tiny-slider

Vanilla javascript slider for all purposes.
MIT License
5.26k stars 785 forks source link

Responsive breakpoints repeating items in slide #616

Open teapottonks opened 4 years ago

teapottonks commented 4 years ago

Issue description: There appears to be an issue with Tiny Slider where if you define a bigger number of items in a responsive breakpoint, then slides are duplicated to fill the space. IE: We only have 4 slides but have set the items to 6 in a responsive breakpoint of 992. The slider shows 6 spaces and fills the first 4 with the 4 slides, but will then duplicate the first 2 to fill spots 5 and 6. If I don't define any responsive breakpoints and set the items to 6, then only the first 4 will show and there will be 2 empty spaces (as expected).

Is there an issue with the breakpoints? Please let us know!

Demo link/slider setting: tns({ "container": '#miniature-slider', "controlsContainer": '#miniature-slider-controls', "loop": true, "items": 6, "nav": false, "autoplay": false, "autoplayButtonOutput": false, "autoHeight": true, "autoplayTimeout": 5000, "speed": 600, "mouseDrag": true, "lazyload": false, "gutter": 20, "startIndex": 0, "responsive": { "480": { "items": 2, "autoplay": true, }, "767": { "items": 3, "autoplay": true, }, "992": { "items": 6, "autoplay": false, } }, });

Tiny-slider version: 2.9.2 Browser name && version: Chrome v 85.0.4183.102 OS name && version: MacOS Catalina v 10.15.5

tuannda commented 11 months ago

How to fix it :)