After deleting all slides in bootstrap carousel except one slide

Hi,

After deleting all slides in bootstrap carousel (except one active slide). Not able to get the current index of last slide which is not deleted. How to get current index of the left over slide. i am able to delete slides using the below code but not able to get the current index after deleting a slide using the button click

the below code i have used for deleting slides.

$("button").click(function() {
  currentIndex = $('div.active').index();
  //  alert(currentIndex);
  var ActiveElement = $carousel.find('.item.active');
  ActiveElement.remove();
  var NextElement = $carousel.find('.item').first();

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.