Im using Slick Slider (http://kenwheeler.github.io/slick/) for my slider and try to put the current slide into the caption.
Code:
var $el = $('.mgu-basic-slider');
$el.on('init'), function() {
console.log('dd');
}
$el.slick({
dots:false,
adaptiveHeight: true,
arrows : true
})
$el.on('reInit afterChange', function(event, slick, currentSlide, nextSlide){
var i = (currentSlide ? currentSlide : 0) + 1;
$( ".slick-counter" ).text(i + '/' + slick.slideCount);
});
It seems, that the inti-function doesn't work, any idea why? Thanks for help
4 years later... but hopefully helps someone... you need to bind init prior to your slider and format your jQuery properly. Not sure about reInit.
var $el = $('.mgu-basic-slider');
$el.on('init', function(slick) { // <-- Your code here was malformed
console.log('Init');
});
$el.slick({
dots:false,
adaptiveHeight: true,
arrows : true
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With