通過BootStrap實(shí)現(xiàn)輪播圖的實(shí)際應(yīng)用
我是用bootstrap來做的很簡單

直接把那坨代碼復(fù)制到 webstorm里面
下面我會(huì)用我的某一次作業(yè) 來做實(shí)際解釋里面的某部分各代表什么意思
(由于這個(gè)代碼到底什么意思 老師沒有教過 我自行理解 有錯(cuò)的地方 望海涵)

“男友秋裝上新”這個(gè)地方 就是個(gè)輪播 一共3個(gè)小點(diǎn) 也就是三張圖 可通過左右的箭頭 左右翻動(dòng)
接下來 奉上源代碼:并在代碼后給各部分做出解釋
<div class="col-md-9 lunbo"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" style="margin-top: 1.4285rem"> <!-- Indicators --> <ol class="carousel-indicators" style="margin-left: -20rem"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"> </li> 這里規(guī)定播放順序 3個(gè)li代表3個(gè)小點(diǎn) 點(diǎn)一個(gè)小點(diǎn) 就是一張圖 <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"> 這里是要播放的圖 3張 <div class="item active">這里的active 對應(yīng)上面active的那個(gè)小圓點(diǎn) <img src="三組項(xiàng)目/PC/PC首頁/lunbo1.jpg" alt="..." style="width: 64rem;height: 31.9285rem"> <div class="carousel-caption"></div> </div> <div class="item"> <img src="三組項(xiàng)目/PC/PC首頁/lunbo2.jpg" alt="..."style="width: 64rem;height: 31.9285rem"> <div class="carousel-caption"></div> </div> <div class="item"> <img src="三組項(xiàng)目/PC/PC首頁/lunbo3.jpg" alt="..."style="width: 64rem;height: 31.9285rem"> <div class="carousel-caption"></div> </div> </div> <!-- Controls --> 這里就是那左右兩個(gè)箭頭 <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">上翻 <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">下翻 <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div>
如果只需兩個(gè)圖 那么就自己改代碼 刪除一個(gè)圖片 一個(gè)圓點(diǎn) 并改好圓點(diǎn)那里
data-slide-to="0" 里面的數(shù)字 這里的0 只是舉例數(shù)字 具體情況 自行判斷
以上所述是小編給大家介紹的通過BootStrap實(shí)現(xiàn)輪播圖的實(shí)際應(yīng)用,希望對大家有所幫助,如果大家有任何疑問歡迎給我留言,小編會(huì)及時(shí)回復(fù)大家的!
- 利用BootStrap的Carousel.js實(shí)現(xiàn)輪播圖動(dòng)畫效果
- 使用BootStrap進(jìn)行輪播圖的制作
- BootStrap實(shí)現(xiàn)輪播圖效果(收藏)
- 使用BootStrap建立響應(yīng)式網(wǎng)頁——通欄輪播圖(carousel)
- Bootstrap輪播圖的使用和理解4
- Bootstrap幻燈片輪播圖支持觸屏左右手勢滑動(dòng)的實(shí)現(xiàn)方法
- BootStrap實(shí)現(xiàn)手機(jī)端輪播圖左右滑動(dòng)事件
- Bootstrap開發(fā)實(shí)戰(zhàn)之響應(yīng)式輪播圖
- Bootstrap每天必學(xué)之響應(yīng)式導(dǎo)航、輪播圖
- Bootstrap實(shí)現(xiàn)基于carousel.js框架的輪播圖效果
相關(guān)文章
你所不了解的javascript操作DOM的細(xì)節(jié)知識點(diǎn)(一)
這篇文章主要介紹了你所不了解的javascript操作DOM的細(xì)節(jié)知識點(diǎn)的相關(guān)資料,需要的朋友可以參考下2015-06-06
Bootstrap實(shí)現(xiàn)的標(biāo)簽頁內(nèi)容切換顯示效果示例
這篇文章主要介紹了Bootstrap實(shí)現(xiàn)的標(biāo)簽頁內(nèi)容切換顯示效果,結(jié)合完整實(shí)例形式分析了基于Bootstrap實(shí)現(xiàn)的標(biāo)簽頁內(nèi)容切換顯示功能相關(guān)操作技巧,非常簡單實(shí)用,需要的朋友可以參考下2017-05-05
javascript實(shí)現(xiàn)倒計(jì)時(shí)提示框
這篇文章主要為大家詳細(xì)介紹了javascript實(shí)現(xiàn)倒計(jì)時(shí)提示框,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-03-03
JavaScript實(shí)現(xiàn)忘記密碼功能的示例代碼
這篇文章主要為大家詳細(xì)介紹了如何使用HTML、CSS和JavaScript實(shí)現(xiàn)一個(gè)完整的忘記密碼功能,文中的示例代碼講解詳細(xì),需要的可以參考一下2024-01-01

