I'm a beginner when it comes to bootstrap. I have a Carousel with some slides that include a Decline button. When the button is clicked, I want to delete/remove that slide and move on to the next one. Can this be achieved using JQuery? I've been experimenting with something similar in JSFiddle.
var $carousel = $('#myCarousel'),
$carouselItems = $('.item', $carousel);
$carousel.on('slid.bs.carousel', function (e) {
$carouselItems.removeClass('prev next');
var $active = $(e.relatedTarget);
$active.next().addClass('next');
$active.prev().addClass('prev');
})
$(document).ready(function(){
$("button").click(function(){
$("#div1").remove();
$("#li1").remove();
$("#li2").attr("data-slide-to",0);
$("#li2").attr("data-slide-to",1);
$("#div2").addClass('active');
});
});
Any help would be greatly appreciated. Thank you.