圖片輪播

目前使用的是Boostrap 3 ,並沒有內建圖片輪播的css特效

因此特別寫這篇來實現圖片輪播

圖片輪播html 
 <div id="carousel-example-generic" class="carousel slide center-block" data-ride="carousel">
        <!-- Indicators 下方有幾個點點 -->
        <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>

        <!-- Wrapper for slides 圖片區-->
        <div class="carousel-inner" role="listbox">
            <div class="item active">
                @*<img src="~/Img/BK.jpg" alt="...">*@
                <img src="~/Img/Catalog-banner.jpg" alt="...">
            </div>
            <div class="item">
                <img src="~/Img/Catalog-banner.jpg" alt="...">
            </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>


參考資料:

  1. https://rong1649r.pixnet.net/blog/post/75421941-bootstrap---%E5%B7%A6%E5%8F%B3%E8%BC%AA%E6%92%AD%E3%80%88%E5%9C%96%E7%89%87%E3%80%81%E6%96%87%E5%AD%97...%E3%80%89