使用Bootstraps Carousel,我有一个项目列表。每个项目都有一个“类别”分配给我选择的。我试图使用的逻辑是:
以下是我正在使用但目前无法使用的代码..
<div id="myCarousel" class="carousel slide" data-interval="false">
<div class="carousel-inner" role="listbox">
<div class="item landscape active">...image</div>
<div class="item">...image</div>
<div class="item">...image</div>
<div class="item">...image</div>
<div class="item landscape">...image</div>
<div class="item">...image</div>
<div class="item landscape">...image</div>
$('#myCarousel').on('slide.bs.carousel', function (e) {
var active = $(e.target).find('.carousel-inner > .item.active');
var from = active.index();
var next = $(e.target).find('.carousel-inner > .item.landscape');
var to = next.index();
});