Bootstrap_Carousel.jpg

說明:

  • 此三行為基本,一定要引用,css樣式表 和 js:

<link href="./css/bootstrap.min.css" rel="stylesheet" />

<script src="./js/jquery.min.js"></script> 
<script src="./js/bootstrap.min.js"></script>

  • 標示紅字的部份換成自己圖片的---

尺寸(data-src="holder.js/1164x346/auto/#777:#555/text:First slide")

圖片(src="xx.jpg")

圖片說明(alt="xxx")

 

前端程式:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <!--Bootstrap-->
    <link href="./css/bootstrap.min.css" rel="stylesheet" />
    <!--[if lt IE 9]>
        <script src=https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js></script>
        <script src=https://oss.maxcdn.com/respond/1.4.2/respond.min.js></script>
    <![endif]-->
    <script src="./js/jquery.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container theme-showcase" role="main">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class=""></li>
            <li data-target="#carousel-example-generic" data-slide-to="1" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2" class=""></li>
            </ol>
            <div class="carousel-inner" role="listbox">
                <div class="item"><img data-src="holder.js/1164x346/auto/#777:#555/text:First slide" alt="One" src="./images/Bootstrap_Carousel1.jpg" data-holder-rendered="true" ></div>
                <div class="item active"><img data-src="holder.js/1164x346/auto/#666:#444/text:Second slide" alt="Two" src="./images/Bootstrap_Carousel2.jpg" data-holder-rendered="true" ></div>
                <div class="item"><img data-src="holder.js/1164x346/auto/#555:#333/text:Third slide" alt="Three" src="./images/Bootstrap_Carousel3.jpg" data-holder-rendered="true" ></div>
            </div>
            <a class="left carousel-control" href="https://kkbruce.tw/bs3/Examples/theme#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="https://kkbruce.tw/bs3/Examples/theme#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>
    </div>
    </form>
</body>
</html>

arrow
arrow
    文章標籤
    Bootstrap Carousel
    全站熱搜

    jcgogo 發表在 痞客邦 留言(0) 人氣()