Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to disable slider if slideCount = slideItems ? #53

Closed
darbymanning opened this issue Aug 3, 2017 · 1 comment
Closed

Possible to disable slider if slideCount = slideItems ? #53

darbymanning opened this issue Aug 3, 2017 · 1 comment

Comments

@darbymanning
Copy link

I'm using tiny-slider with the responsive option, to display 4 items -- I wondered if it was possible to have the slider disabled if all the items are visible in the viewport?

Not that this is particularly specific to my code, here it is for reference - might help clarify too:

const newsSlider = tns({
    container: sliderContainer,
    mouseDrag: true,
    nav: false,
    gutter: 32,
    "responsive": {
        "0": 1,
        "680": 2,
        "1000": 3,
        "1300": 4
    }
})

So as there are a total of 4 items in the slider, at 1300px or higher, as the slides are all visible I want to disable the slider (ie. so mouseDrag / controls aren't visible etc). I guess ideally, it would be good to extend the responsive feature so that you can also specify other options for each breakpoint, rather than just number of slides).

@ganlanyuan
Copy link
Owner

ganlanyuan commented Aug 3, 2017

Hey @darbymanning ,
Thanks for your feedback.

If all the items are visible in the viewport

  • controls and nav are not visible.
  • disable mouseDrag, touch, autoplay and arrowKeys. (added in v1.6.0, v2.0.3)
  • extend the responsive feature. (added in v2.1.0)

The last two will be added in the future.
Done

@ganlanyuan ganlanyuan added this to the 2.1.0 milestone Aug 4, 2017
@ganlanyuan ganlanyuan added the bug label Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants