bootstrap是一個非常好用的css框架,裡面整合了各種頁面常用到的排版和特效,圖片輪播就是其中之一啦
Bootstrap影片教學)
BootStrap輪播圖官方程式碼
<!--data-ride设置图片切换方式为滑动 --> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- 设置轮播图的数量和顺序--> <!--data-target的值应与上面的id值对应 --> <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" role="listbox"> <div class="item active"> <img src="..." alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="..." alt="..."> <div class="carousel-caption"> ... </div> </div> ... </div> <!-- 控制图标 --> <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>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="1000">
使用JavaScript語句實作:
官網給的程式碼是:
$(function(){ $('#carousel-example-generic').carousel({interval:1000}); });
Bootstrap教學欄目進行學習!
以上是bootstrap輪播太慢怎麼設定的詳細內容。更多資訊請關注PHP中文網其他相關文章!