slider does not reinitialize on resize if "unslick" is used in breakpoints
See original GitHub issueWhen you configure the slider to destroy on a certain breakpoint, it is not reinitialized after resizing the browser because the “resize” event is detached when you perform “unslick”.
$('.slider').slick({
dots: false,
infinite: true,
arrows: false,
speed: 200,
slidesToShow: 1,
mobileFirst: true,
responsive: [
{
breakpoint: 768,
settings: 'unslick'
}
]
});
Demo can be found here: https://jsfiddle.net/v5c755kp/
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Mobile first Carousel does not reinitialize after unslick ... - Drupal
When creating a slick carousel, that unslicks at a certain breakpoint, the carousel does not reinitialize when the breakpoint is adjusted ...
Read more >Prevent re-init of slick slider on window resize - Stack Overflow
Instead of reinitializing you should just call .slick("resize") on that element when the window is resized. In your example this would be:.
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 >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 >slick slider error Uncaught TypeError: Cannot read property ...
I have applied slick slider in the phtml file but is giving error ... //Now it will not throw error, even if called...
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
@mazzaker @simeydotme Yes, it is not a bug, but I think it is not a good choice for user to reinit it by userself. Slick should have its own instance props to log its breakpoint which causes unslick event, and next time to reinit by slick self.
If there are many slicks in one page, user should not reinit slick one by one. It causes a big trouble in my case. I think the best idea is slick can reinit by itself.