这是我的标记:
<div id="carousel-example-generic" class="carousel slide" data-interval="false" data-pause="hover">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div style="height:200px;">Slide 1</div>
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<div style="height:200px;">Slide 2</div>
<div class="carousel-caption">
...
</div>
</div>
<div class="item ">
<div style="height:200px;">Slide 3</div>
<div class="carousel-caption">
...
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
我正在使用bootstrap v3.0.3,但是在加载页面后轮播仍然开始滚动。我也试过包括:
$(function () {
$(".carousel").carousel({ interval: false });
});
我在有data-interval
属性的情况下完成了此操作,但都无济于事。加载页面后,轮播会自动开始滚动。我已经看到了有关此问题的其他问题,但它们都是指旧版本,并暗示它现在已经修复。
有什么想法吗?