Slick: init event and get current slide do not work

Created on 12 Mar 2015  路  5Comments  路  Source: kenwheeler/slick

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?

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.

All 5 comments

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');
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephane-r picture stephane-r  路  3Comments

NozX18 picture NozX18  路  3Comments

crstauf picture crstauf  路  3Comments

eirikrlee picture eirikrlee  路  3Comments

xtatanx picture xtatanx  路  3Comments