Hi,
I am using the init callback which works but I am currently trying to get that first slides object data when you first load the slider (on init). Does anyone know how this can be done?
Same here, I can't get the initevent to fire.
$(slider).on('init', function (evt, slick, direction) {
// nothing
});
Not sure if this will help, but I've read that the .on('init must come before instantiating slick. See https://github.com/kenwheeler/slick/issues/1057#issuecomment-85200882
Please add to the docs that the init listener has to be defined BEFORE the slick object.
@mhulse is correct. This is just general JS knowledge :)
This should not have been closed. The problem the OP is talking about is that $('.your-element').slick('slickCurrentSlide'); does not work when used in the init event.
$('ul.slider').on('init', function(slick){
var currentSlide = $(this).find('li.slide.slick-current');
});
Most helpful comment
This should not have been closed. The problem the OP is talking about is that $('.your-element').slick('slickCurrentSlide'); does not work when used in the init event.