javascript - How to get the current slide no in Glide.js -
hi how can current slide no when click next , previous button in glide.js http://glide.jedrzejchalubek.com/docs.html#intro.
var carousel = $('#carousel').glide({ type: 'carousel', startat: 1, touchdistance: 2, afterinit:function(){console.log("paintslider")}, autoplay: 0 }); console.log(carousel.current());
for reason, function carousel.current()
not working.
you can use code's callback , events instead. example:
var carousel = $('#carousel').glide({ type: 'carousel', ... aftertransition : function(event) { console.log(event.index); // current slide number } });
also, carousel.index()
works too!
Comments
Post a Comment