这个旋转木马看起来很简单,但我无法让它工作
非常感谢任何帮助:-)
看到它有帮助: http: //www.bootply.com/70201
它使用 Bootstrap 3,直接从Bootstrap 文档和 javascript 上的轮播示例中提取 HTML
<script type="text/javascript" >
$(document).ready(function() {
$('.carousel').carousel()
});
</script>
我还注意到您的占位符图像的来源目前对我来说已关闭,因此我正在为幻灯片图像使用另一个 URL
祝你好运!
HTML
<div id="carousel-example-generic" class="carousel slide">
<!-- Indicators -->
<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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/900x500" alt="">
<div class="carousel-caption">
slide 1
</div>
</div>
<div class="item">
<img src="http://placehold.it/900x500" alt="">
<div class="carousel-caption">
slide 2
</div>
</div>
<div class="item">
<img src="http://placehold.it/900x500" alt="">
<div class="carousel-caption">
slide 3
</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>
您的代码中没有包含 holder.js 请添加以下行
<script type='text/javascript' src="http://imsky.github.io/holder/holder.js"></script>