Reinit slider when leaving a breakpoint with settings: 'unslick'
See original GitHub issueHey there, really love your plugin, I use it in nearly every project – thanks for the great work. I observed a counter-intuitive behaviour with the following init code:
var slickBaseSettings = {
infinite: false,
slide: '.is-slide',
adaptiveHeight: true,
dots: false,
slidesToShow: 4,
arrows: true
};
$('.is-slider').slick( $.extend({
responsive: [{
breakpoint: 640,
settings: 'unslick'
}]
}, slickBaseSettings) );
One would expect that once leaving the breakpoint the slider reinitializes but it is not the case. Am I missing something?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8
Top Results From Across the Web
Responsive breakpoints not working for slick slider
@ntgCleaner Slider doesn't break after I resize the browser. It works fine but that settings doesn't work. If I reload the page at...
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 >58edf23342d377302ce104e59fb...
Set settings to "unslick" instead of an object to disable slick at a given ... rtl, boolean, false, Change the slider's direction to...
Read more >https://www.aamu.edu/_resources/ldp/galleries/slic...
Enables settings at given `breakpoint`. Set `settings` to "unslick" instead of an object to disable slick at a given breakpoint. rows | int...
Read more >slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, CSS3 transitions, touch events/swiping & much more!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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 those who stumble across this issue through Google, I did a writeup on my company’s blog demonstrating how to cleanly re-initialize Slick carousel in a responsive setting, after destroying it via
unslick
.Hopefully this helps someone else 😃