Unslick responsively
See original GitHub issueI have a slider with four elements, at a screen size greater than a certain breakpoint, I’d like to disable slick and use CSS to render them as a 2x2 block grid. Is there a way to do this, or can it be added so you can have something like
$('.responsive').slick({
dots: true,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [
{
breakpoint: 1024,
settings: {
unslick: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
Issue Analytics
- State:
- Created 9 years ago
- Reactions:5
- Comments:68 (7 by maintainers)
Top Results From Across the Web
Is it possible to unslick/hide a Slick slider for desktops but slick ...
Much cleaner solution than the currently accepted answer: Add the mobileFirst: true, option: $('.slider').slick({ slidesToShow: 5, ...
Read more >how to resize slick and unslick - CodePen
Resize the browser to see it working. An example showing how to start and stop slick responsible, like the "unslick" property but re-slicking...
Read more >(Truly) Responsive Slick Slider Code - Frontend.services |
It does but with one huge issue – once element is turned from Slick to no Slick it can never get back into...
Read more >slickslide pc:unslick after mobile:slick - 네이버 블로그
('.slider').slick({ slidesToShow: 5, slidesToScroll: 1, autoplay: false, autoplaySpeed: 2000, responsive: [ { breakpoint: 9999, ...
Read more >slick slider unslick responsive Code Example - Code Grepper
('.your-slider').slick('unslick');
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For me overwriting core file as @ashussen supposed was not an option. The only working solution is writing custom “reslicking” function:
I disagree @kenwheeler. A usecase could be that a slider could be working on an iPad portrait and the user turns ipad to landscape, and then back to portrait. If the breakpoint was between those two sizes the slider would no longer be functioning when it should be.