我的导航栏运行不正常。它同时在垂直行中显示 3 个 slider 图像,并且不会滑动图片。使用的 CSS 是 twitter bootstrap 的 CSS。我有自己的 CSS,但没有影响轮播,也没有添加 javascript,只有 Jquery 和 bootstrap.js。这是 Bootstrap V3。任何想法?
<div class="container">
<div id="carousel-example-generic" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-
slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-
slide-to="1"></li>
<li data-target="#carousel-example-generic" data-
slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="img/timthumb.jpg" alt="...">
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
<div class="item active">
<img src="img/timthumb.jpg" alt="...">
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
<div class="item active">
<img src="img/timthumb.jpg" alt="...">
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-
example-generic" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-
example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
</div>
最佳答案
您的问题似乎是您为所有幻灯片指定了 active
类。 仅指定第一个开始的。为所有这些指定 active
使它们全部可见,并且它的选择器在幻灯片中切换(不是上一个事件元素)或下一步点击按钮无法拾取任何其他东西)无法选择,因为没有任何非事件的可用了。
<div class="item active">
<img src="http:\\placehold.it\32x100" alt="..." />
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
<div class="item"> <!-- removed active class from here -->
<img src="http:\\placehold.it\42x100" alt="..." />
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
<div class="item"><!-- removed active class from here -->
<img src="http:\\placehold.it\52x100" alt="..." />
<div class="carousel-caption">
<p>Eyes of the owl</p>
</div>
</div>
关于javascript - 导航栏无法正常工作(bootstrap v3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18907860/