码迷,mamicode.com
首页 > 其他好文 > 详细

Bootstrap幻灯片

时间:2015-09-12 20:23:33      阅读:280      评论:0      收藏:0      [点我收藏+]

标签:

 技术分享

Bootstrap幻灯片的制作利用到了Carousel插件,包含:左右箭头、图片、点点导航

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators 小点点导航 从0开始-->
    <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>
    </ol>

    <!-- Wrapper for slides 轮播组件内容 -->
    <div class="carousel-inner" role="listbox">
        <div class="item active">
            <img src="images/chrome-big.jpg" alt="图片1">
            <div class="carousel-caption">
                图片1描述-可选
            </div>
        </div>
        <div class="item">
            <img src="images/firefox-big.jpg" alt="图片2">
            <div class="carousel-caption">
                图片2描述-可选
            </div>
        </div>

    </div>

    <!-- Controls 左右切换按钮-->
    <a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div>

 补充样式:

    <style>
        /*限制幻灯片高度*/
        .carousel{height: 500px;}
        .carousel .item{height: 500px;}
        /*图片可跟随窗口缩放*/
        .carousel img{width: 100%;}
    </style>

 

详情:http://v3.bootcss.com/javascript/#carousel

 

Bootstrap幻灯片

标签:

原文地址:http://www.cnblogs.com/tinyphp/p/4803453.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!