Hot to set resposive `panelsPerView` on different screen sizes?
stefanobartoletti opened this issue · 2 comments
First of all thanks for this slider, it is very simple and easy to setup and works wonderfully.
I'm willing to set a different value for panelsPerView
based on screen size, so that I only have a single panel on mobile but 3 or more on desktop views.
In the docs I can see that there are no separate options for this, does the API have a way to easily accomplish this?
I see that in the docs site homepage the "framework ready" carousel is doing this. Is it done via some particular setting?
Thanks
Hello @stefanobartoletti.
Our component does not support this feature as an option.
I think you can implement this by updating flicking.panelsPerView
when the width of the window changes, or checking the window's initial width if you want to set panelsPerView
only once.
I've made a demo that flicking.panelsPerView
changes by window size.
Can you check if is this the implementation you wanted?
Thanks for your reply @malangfox.
This seems to be a great solution. I will try this and see if it is good for my case, meanwhile I tried to set a maximum width on the "panel" and it achieved more or less the same thing, without having to resort to javascript.
But I will check this solution too as soon as I can, maybe it will come in handy on other cases.