slick: Init event not being triggered.
Required fiddle: http://jsfiddle.net/q3yc3gap/ reproduced here for clarity:
/**
init event not being triggered
**/
function algo(message) {alert(message)}
algo('works')
$(".slider").on('init', function(){algo("doesn't")});
$(".slider").slick();
/* Alternative cases */
// $(".slider").slick().on('init', function(){algo("doesn't")});
// slide = $(".slider").slick();
// slide.on('init', function(){algo("doesn't")});*/
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 24
Please add to the docs that the init listener has to be defined BEFORE the slick object.
I’ve found a solution to this problem, just call the on(‘init’) function before the slick function
3 and a half friggin years, still no mention of proper order of operations in the documentation. Does no one care about clarity and detail anymore? I started on Bootstrap’s carousel and that is so full of errors it’s not even usable. This one’s way better, but how about listening to feedback and making improvements.
This got me too. If the docs showed the event listeners in the context of the slick function it would remove a lot of confusion.
Also giving my +1 to @nikolowry for his heads-up answer.
Perhaps an alternate way to handle lessening the confusion of when this and the ‘reInit’ handlers need to be defined would be to pass the handler functions into the settings object (maybe in an ‘events’ container object).