我已经开始<b:carousel>
在 BootsFaces 0.8.0 中实现一个组件。在撰写本文时(2015 年 9 月 15 日),如果您从源代码构建 BootsFaces,您已经可以对其进行测试。
与此同时——或者如果你需要比我的组件提供的更多的灵活性——你可以从 BootsFaces repo (carousel.css, carousel.js) 下载 CSS 和 JS 文件并像这样构建你自己的轮播:
<!-- If you're using BootsFaces 0.7.0 or below, you need to download the CSS and JS files
from
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/master/mavenResources/META-INF/resources/bsf/css/carousel.css
and
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/master/mavenResources/META-INF/resources/bsf/js/carousel.js
and correct the next two lines! -->
<h:outputStylesheet library="bsf" name="css/carousel.css" />
<h:outputScript library="bsf" name="js/carousel.js" />
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="width:800px">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="Valladolid1.png" alt="Valladolid" style="width:800px;height:600px"/>
</div>
<div class="item">
<img src="Valladolid2.png" alt="Valladolid" style="width:800px;height:600px"/>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>