我在实现引导转盘时遇到了问题。谁能看一下下面的html和js,并给我如何实现幻灯片的说明。.js尚未编辑,旋转木马安装在body hero单位上。我要实现carousel api吗?如何定义在.js文件中使用的轮播?谢谢。
<div class="carousel">
<!-- Carousel items -->
<div class="carousel-inner">
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-large">Learn more »</a></p>
</div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div>发布于 2012-02-09 06:33:35
这里提供了引导转盘的文档:http://twitter.github.com/bootstrap/javascript.html#carousel
我猜你可能需要添加一些类似这样的东西来让它运行:
<script type="text/javascript">
$(function(){
$('.carousel').carousel();
});
</script>发布于 2012-02-25 01:35:38
注意:此答案最初适用于 (可能不适用于版本3)
您必须将"item“类放在所有幻灯片上,并将"active”类放在第一张幻灯片上。这对我很有效。
<div class="carousel">
<div class="carousel-inner">
<!-- your slide -->
<div class="hero-unit item active">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-large">Learn more »</a></p>
</div>
</div>
</div>就像Christopher说的,你需要使用这个函数来启动它。
<script type="text/javascript">
$(function(){
$('.carousel').carousel();
});
</script>发布于 2012-02-14 15:46:14
我的理解是
<div class="carousel">需要的是
<div id="myCarousel" class="carousel">其中id是“箭头”的href是什么。
https://stackoverflow.com/questions/9202452
复制相似问题