目前使用的是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>
參考資料: