欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

BootStrap中jQuery插件Carousel實(shí)現(xiàn)輪播廣告效果

 更新時(shí)間:2017年03月27日 11:26:49   作者:一顆冉冉升起的新星  
輪播廣告在網(wǎng)站中的應(yīng)用實(shí)在是太常見(jiàn)了,下面說(shuō)一說(shuō)怎樣使用bootstrap中的Carousel插件來(lái)實(shí)現(xiàn)輪播廣告效果,感興趣的朋友一起看看吧

輪播廣告在網(wǎng)站中的應(yīng)用實(shí)在是太常見(jiàn)了,下面說(shuō)一說(shuō)怎樣使用bootstrap中的Carousel插件來(lái)實(shí)現(xiàn)輪播廣告效果,下圖為最終效果:

這里寫(xiě)圖片描述

具體實(shí)現(xiàn)方法請(qǐng)看下面的代碼:

<div class="carousel slide" data-ride="carousel" id="carousel" data-interval="3000"> //data-interval設(shè)置輪播間隔為3秒鐘
 <!-- 廣告序號(hào)指示器(表示當(dāng)前第幾張的下方的幾個(gè)小圓圈),可加可不加 -->
 <ol class="carousel-indicators">
  <li data-target="#carousel" data-slide-to="0"></li>
  <li data-target="#carousel" data-slide-to="1" class="active"></li>
  <li data-target="#carousel" data-slide-to="2"></li>
  <li data-target="#carousel" data-slide-to="3"></li>
 </ol>
 <div class="carousel-inner">
  <div class="item">
   <img src="img/02.jpg" alt=""/>
   <!-- 為廣告添加說(shuō)明文字,在圖片上中下方顯示,可加可不加 -->
   <div class="carousel-caption">
    <h3>First slide label</h3>
    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
   </div>
  </div>
  <div class="item active">
   <img src="img/03.jpg" alt=""/>
   <!-- 為廣告添加說(shuō)明文字,在圖片上中下方顯示,可加可不加 -->
   <div class="carousel-caption">
    <h3>Second slide label</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
   </div>
  </div>
  <div class="item">
   <img src="img/04.jpg" alt=""/>
   <!-- 為廣告添加說(shuō)明文字,在圖片上中下方顯示,可加可不加 -->
   <div class="carousel-caption">
    <h3>Third slide label</h3>
    <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
   </div>
  </div>
  <div class="item">
   <img src="img/05.jpg" alt=""/>
   <!-- 為廣告添加說(shuō)明文字,在圖片上中下方顯示,可加可不加 -->
   <div class="carousel-caption">
    <h3>Fourth slide label</h3>
    <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
   </div>
  </div>
 </div>
 <!-- 上一張的按鈕,可加可不加 -->
 <a class="left carousel-control" href="#carousel" rel="external nofollow" rel="external nofollow" data-slide="prev">
  <span class="glyphicon glyphicon-chevron-left"></span>
 </a>
 <!-- 下一張的按鈕,可加可不加 -->
 <a class="right carousel-control" href="#carousel" rel="external nofollow" rel="external nofollow" data-slide="next">
  <span class="glyphicon glyphicon-chevron-right"></span>
 </a>
</div>

如代碼中注釋?zhuān)瑥V告序號(hào)指示器,廣告的說(shuō)明文字,以及上一張、下一張的按鈕都是可以根據(jù)需要自行添加的。

可以在carousel類(lèi)中添加data-interval擴(kuò)展屬性來(lái)更改輪播的時(shí)間間隔。

以上所述是小編給大家介紹的BootStrap中jQuery插件Carousel實(shí)現(xiàn)輪播廣告效果,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論