$('#slideshow-carousel-1').carousel({ interval: 100, pause: false, wrap: true }); $('#landingCarousel').carousel({ interval: 100, pause: false, wrap: true }); $('#myCarousel').carousel({ interval: 1600 }); // handles the carousel thumbnails $('[id^=carousel-selector-]').click(function () { var id_selector = $(this).attr("id"); console.log(id_selector); var id = id_selector.substr(id_selector.lastIndexOf("-") + 1); id = parseInt(id); $('#myCarousel').carousel(id); $('[id^=carousel-selector-]').removeClass('selected'); $(this).addClass('selected'); }); // when the carousel slides, auto update $('#myCarousel').on('slid', function (e) { var id = $('.item.active').data('slide-number'); id = parseInt(id); $('[id^=carousel-selector-]').removeClass('selected'); $('[id^=carousel-selector-' + id + ']').addClass('selected'); });