zoukankan      html  css  js  c++  java
  • Bootstrap的js插件之轮播(carousel)

    轮播请查看下面演示样例。基本已经涵盖最经常使用的一个轮播

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <title>js插件_轮播</title>
        <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
        <!--<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">-->
        <script src="js/jquery-1.11.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <style type="text/css">
            .myCarousel{
                50%;
            }
        </style>
    </head>
    <body>
    <div class="container myCarousel">
        <div id="carousel-example-generic" class="carousel slide">
            <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>
            <div class="carousel-inner">
                <div class="item active">
                    <img src="images/1.jpg"/>
                    <div class="carousel-caption">
                        <h3>宅男女神1</h3>
                        <p>人气偶像票选890张</p>
                    </div>
                </div>
                <div class="item">
                    <img src="images/2.jpg"/>
                    <div class="carousel-caption">
                        <h3>宅男女神2</h3>
                        <p>人气偶像票选1234张</p>
                    </div>
                </div>
                <div class="item">
                    <img src="images/3.jpg"/>
                    <div class="carousel-caption">
                        <h3>宅男女神3</h3>
                        <p>人气偶像票选7836张</p>
                    </div>
                </div>
            </div>
            <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
        </div>
    </div>
    <script>
        //设置图片切换时间,默认是5秒;
        $(".carousel").carousel({
            interval:2000
        })
    </script>
    
    </body>
    </html>


  • 相关阅读:
    程序员最怕的事
    钱钟书是怎样做读书笔记的 杨绛
    编码风格不是编码规范
    Google Reader明日关闭:14款替代品对比
    移动应用设计领域中最拔尖的15大应用
    TOGAF:企业信息化复杂吗?
    敏捷个人回顾以及体系2014版线下分享活动
    敏捷个人手机应用iOS和Android公开注册
    IT人的自我导向型学习:学习的4个层次
    IT人的自我导向型学习:学习的3个维度
  • 原文地址:https://www.cnblogs.com/blfbuaa/p/6776197.html
Copyright © 2011-2022 走看看