Slick Init - Cannot pause slider
See original GitHub issueHello,
When trying to pause the slider within the init listener the “slick(‘slickPause’)” method doesn’t work with the error
Uncaught TypeError: Cannot read property 'slickPause' of undefined
An example piece of code is:
var opts = {
autoplay: true,
autoplaySpeed: 5000,
speed: 750,
fade: true,
arrows: false,
appendDots: $('.nav-wrap div'),
dots: true,
};
$(elem).on('init', function(event, slick){
var slider = slick.$slider;
slider.slick('slickPause');
});
$(elem).slick(opts);
It seems like you need a ‘ready’ event or similar to help resolve this?
Thanks, Dean
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
javascript - Slick Init - slickPause undefined - Stack Overflow
This would pause the carousel right away assuming the first slide is a video. If it's not always the first slide, you can...
Read more >Developers - Slick Init - Cannot pause slider - - Bountysource
Hello,. When trying to pause the slider within the init listener the "slick('slickPause')" method doesn't work with the error
Read more >[Resolved] Stop audio player in Slick carousel when ... - Toolset
Problem : I have a custom audio field displayed in a Slick carousel. When the carousel paginates, I would like to stop the...
Read more >kenwheeler/slick - Gitter
I have a problem with slides made of multiple sub-divs. They show correctly when page is loaded. But when the infinite carousel goes...
Read more >slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, ... Initialize your slider in your script file or an inline script...
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
Run
$slider.slick('slickPause');
just after the initialization seems to be working: https://jsfiddle.net/yzxyh435/1/So,
$slider.slick({...});
seems to be sequential and not asynchronous and to wait for the event does not seem to be necessary.Contradict someone?
Its dirty but works 😕