I am attempting to get the index of the current item in a JCarousel so that I can display the current position within the Carousel to the user. For example, \'13/20\'.
H
var jcarousel = $('.jcarousel').on('jcarousel:createend', function(event, carousel) {
do_something_with_current_slide(carousel); //in case if you need current slide on the begining
})
.on('jcarousel:animateend', function(event, carousel) {
do_something_with_current_slide(carousel); //do something with current slide right after animation ends
})
.jcarousel({
wrap: 'circular'
});
function do_something_with_current_slide(carousel){
li = carousel._target; //li of current slide
alert(li.attr('slide'));
}
you can use any number of attributes to indentify slide and data inside