zoukankan      html  css  js  c++  java
  • Bootstrap幻灯片

     

    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

  • 相关阅读:
    python条件判断之直接加数字
    pythontip题目解答
    twitter api取出的日期格式化
    MySQL Archive存储引擎
    Python Json序列化
    Python 装饰器
    Python 匿名函数
    Python 函数
    Python 字符编码
    Python 文件操作
  • 原文地址:https://www.cnblogs.com/tinyphp/p/4803453.html
Copyright © 2011-2022 走看看