Bootstrap 3 个轮播导航器处于活动状态 class 未更新
Bootstrap 3 carousel navigator active class not updating
导航器导航幻灯片没有问题,除了活动 class 留在第一个导航器上。
这是我的代码:
<div id="homepanel" class="carousel slide" data-ride="carousel" data-interval="5000">
<!-- Indicators -->
<div class="row">
<div class="col-sm-4">
<ol class="home-tabs">
<li>Featured Products</li>
<li data-target="#homepanel" data-slide-to="0" class="active"><a href="#">Slide 1</a></li>
<li data-target="#homepanel" data-slide-to="1"><a href="#">Slide 2</a></li>
</ol>
</div>
<div class="col-sm-8">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-sm-6">
<img alt="Cardboard Boxes" src="/slide1.png" class="no-border-radius">
</div>
<div class="col-sm-6">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi, sint.</p>
</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-6">
<img alt="Multi-wall Sacks" src="/slide2.jpg" class="no-border-radius">
</div>
<div class="col-sm-6">
<div class="content">
<p>Molestiae incidunt excepturi dolorum autem eum illum ipsa facilis sed.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
li.active 完全没有变化。我的代码中是否缺少任何内容?有什么想法吗?
我在这里附上了一个 jsfiddle link:http://jsfiddle.net/wpyz4c22/
Carousel 需要额外的 class 指示器来改变 li 活动状态。你哪里缺少 class : .carousel-indicators
在这里找到 JSFiddle:http://jsfiddle.net/Bladepianist/tzrnjdkk/
<div id="homepanel" class="carousel slide" data-ride="carousel" data-interval="5000">
<!-- Indicators -->
<div class="row">
<div class="col-sm-4">
<ol class="home-tabs carousel-indicators">
<li data-target="#homepanel" data-slide-to="0" class="active"><a href="#">Slide 1</a></li>
<li data-target="#homepanel" data-slide-to="1"><a href="#">Slide 2</a></li>
</ol>
</div>
<div class="col-sm-8">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-sm-6">
<img alt="Cardboard Boxes" src="http://placehold.it/310x200" class="no-border-radius">
</div>
<div class="col-sm-6">
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-6">
<img alt="Multi-wall Sacks" src="http://placehold.it/310x200" class="no-border-radius">
</div>
<div class="col-sm-6">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
导航器导航幻灯片没有问题,除了活动 class 留在第一个导航器上。
这是我的代码:
<div id="homepanel" class="carousel slide" data-ride="carousel" data-interval="5000">
<!-- Indicators -->
<div class="row">
<div class="col-sm-4">
<ol class="home-tabs">
<li>Featured Products</li>
<li data-target="#homepanel" data-slide-to="0" class="active"><a href="#">Slide 1</a></li>
<li data-target="#homepanel" data-slide-to="1"><a href="#">Slide 2</a></li>
</ol>
</div>
<div class="col-sm-8">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-sm-6">
<img alt="Cardboard Boxes" src="/slide1.png" class="no-border-radius">
</div>
<div class="col-sm-6">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi, sint.</p>
</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-6">
<img alt="Multi-wall Sacks" src="/slide2.jpg" class="no-border-radius">
</div>
<div class="col-sm-6">
<div class="content">
<p>Molestiae incidunt excepturi dolorum autem eum illum ipsa facilis sed.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
li.active 完全没有变化。我的代码中是否缺少任何内容?有什么想法吗?
我在这里附上了一个 jsfiddle link:http://jsfiddle.net/wpyz4c22/
Carousel 需要额外的 class 指示器来改变 li 活动状态。你哪里缺少 class : .carousel-indicators
在这里找到 JSFiddle:http://jsfiddle.net/Bladepianist/tzrnjdkk/
<div id="homepanel" class="carousel slide" data-ride="carousel" data-interval="5000">
<!-- Indicators -->
<div class="row">
<div class="col-sm-4">
<ol class="home-tabs carousel-indicators">
<li data-target="#homepanel" data-slide-to="0" class="active"><a href="#">Slide 1</a></li>
<li data-target="#homepanel" data-slide-to="1"><a href="#">Slide 2</a></li>
</ol>
</div>
<div class="col-sm-8">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-sm-6">
<img alt="Cardboard Boxes" src="http://placehold.it/310x200" class="no-border-radius">
</div>
<div class="col-sm-6">
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-6">
<img alt="Multi-wall Sacks" src="http://placehold.it/310x200" class="no-border-radius">
</div>
<div class="col-sm-6">
</div>
</div>
</div>
</div>
</div>
</div>
</div>