How do I get the current index from the carousel?
In this case I am using an unordered list. I know I could search through the list items to find the one with the \'
For bootstrap 3 it's
$('#myCarousel').on('slide.bs.carousel', function (e) {
var active = $(e.target).find('.carousel-inner > .item.active');
var from = active.index();
var next = $(e.relatedTarget);
var to = next.index();
console.log(from + ' => ' + to);
})
from https://github.com/twbs/bootstrap/pull/2404#issuecomment-22362366