Tiny-slider: Slider breaks if number of slides is lower than `items` setting

Created on 18 Nov 2017  Â·  10Comments  Â·  Source: ganlanyuan/tiny-slider

__Issue description__:
When number of slides is lower than items option the plugin breaks.

__Screenshot__:
That's what happens when I set items option to 5 and have only 4 slides in the code.
screen shot 2017-11-18 at 23 41 43


_Tiny-slider version_: 2.3.4
_Browser name && version_: Google Chrome 62.0.3202.94
_OS name && version_: macOS 10.12.6

bug

All 10 comments

Thanks @norin89 ,will check it soon
Related to #104

May I know your settings? Or a codepen demo?
I can't reproduce this issue.

Sure:

  var slider = tns({
    container: '.slider',
    items: 9,
    loop: false,
  });

and only 4 slides in the code.

It seems that loop: false; is the key. Other way the slider doesn't break.

Could you check this commit?
Looks fine for me now.

@ganlanyuan it seems to work well in my case.

But... For some reason when I set items: 99 for base in scripts.js (w/o loop: false option) I see the same error and the slider breaks.

Okay, will check this again later.
Thanks for your feedback

Sent from ProtonMail mobile

-------- Original Message --------
On Nov 18, 2017, 6:52 PM, Marcin Goscicki wrote:

@ganlanyuan it seems to work well for my issue.

But... For some reason when I set items: 99 for base in scripts.js (w/o loop: false option) I see the same error and the slider breaks.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Hey,
It works fine to me after I changed the items to 99 or any greater numbers.
I made a demo so you could check it: https://codepen.io/ganlanyuan/pen/MOrZxd

Sorry, it break with huge items amount and loop: true - https://codepen.io/anon/pen/yPprPR

Published a new release for this.

Was this page helpful?
0 / 5 - 0 ratings