Can you please let me know how I can get the total and current number of the carousel slides in bootstrap like the image below?
var totalItemsPop = $('#Mycarousel .item').length;
$('#Mycarousel').on('slide.bs.carousel', function() {
setTimeout(function(){
currentIndexPop = $('#Mycarousel div.active').index() + 1;
$('.num').html('' + currentIndexPop + '/' + totalItemsPop + '');
}, 1000);
});
after slide event, div will be active and can not get active index, so keep your code inside set time out function