ganlanyuan / tiny-slider

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

Slider not obeying number of items #408

Open opr opened 5 years ago

opr commented 5 years ago

Issue description: I have items set to 1, but my slider is showing 6 items. I have a more elaborate use-case locally with responsive options, but this is a reproduction without using the responsive option. Also notice the slide behaviour is not working correctly, it looks to be moving the entire slider rather than just individual slides.

Cheers!

Demo link/slider setting: https://codepen.io/opr/pen/zXjYNG

Tiny-slider version: 2.9.2

trailsnail commented 5 years ago

Hi @opr ,

what is your expected behavior? If you set a width to .deal-slider__inner e.g. 300px you have a centered slider with one sliding element. I think, the slider itself require some outer dimensions from you :) Otherwise the available place is filled with slides.

image

Other solution: be sure, that every slide element itself uses the whole width of the slider container image