【发布时间】:2015-06-21 04:14:39
【问题描述】:
我正在将引导轮播实现到我的页面中,但是我只能看到第一项(包含 3 个部分),而看不到其他两个。
在 bootply http://www.bootply.com/A465PmKBRm 中它正在工作,但在我的网站上却没有。用我正在使用的版本进行了测试。
我在这里错过了什么?
<div class="row">
<div id="carousel-content" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-content" data-slide-to="0" class="active"></li>
<li data-target="#carousel-content" data-slide-to="1" class=""></li>
<li data-target="#carousel-content" data-slide-to="2" class=""></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
</div>
<div class="item">
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
</div>
<div class="item">
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
<!-- SINGLE SERVICE -->
<div class="col-md-4 single-service wow fadeIn animated animated animated" data-wow-offset="10" data-wow-duration="1.5s" style="visibility: visible; -webkit-animation-duration: 1.5s;">
<!-- SERVICE HEADING -->
<h3>text</h3>
<!-- SERVICE DESCRIPTION -->
<p>description</p>
</div>
<!-- /END SINGLE SERVICE -->
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-content" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-content" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
【问题讨论】:
-
恐怕我不知道如何解决这个问题。您发布了一个工作版本并询问它为什么不工作。很明显,你的生活环境有一些东西正在破坏它。页面是否有 404 或 JS 错误?
-
您好像缺少 bootstrap.js ?所以它只适用于布局(例如,带有“display:block”的活动类,但对于其他没有活动的“display:none”)
-
如果您解决了自己的问题,正确的做法是分享您的答案,以便其他人可以从您学到的知识中受益。
-
1.看来你没有添加结束js || 2. 链接
-
@Xalloumokkelos 您使用的是哪个浏览器?检查开发者控制台是否有任何错误并将其包含在您的问题中
标签: javascript jquery html css twitter-bootstrap