本文實(shí)例講述了jQuery自適應(yīng)輪播圖插件Swiper用法。分享給大家供大家參考,具體如下:
運(yùn)行效果截圖如下:

示例代碼如下:
<!DOCTYPE html><html lang="zh-cn"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"><title>新建H5自適應(yīng)模板</title><link rel="stylesheet" href="swiper-3.3.1.min.css"><style>html, body { position: relative; height: 100%;}body { background: #eee; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color:#000; margin: 0; padding: 0;}.swiper-container { width: 100%; height: 100%;}.swiper-slide { text-align: center; font-size: 18px; background: #fff; display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center;}</style></head><body><div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"><img src="images/banner01.jpg"></div> <div class="swiper-slide"><img src="images/banner02.jpg"></div> <div class="swiper-slide"><img src="images/banner03.jpg"></div> </div> <div class="swiper-pagination"></div></div><script src="jquery-1.10.1.min.js"></script><script src="swiper-3.3.1.jquery.min.js"></script><script>var swiper = new Swiper('.swiper-container', { pagination: '.swiper-pagination', paginationClickable: true});</script></body></html>關(guān)于swiper的內(nèi)容讀者可參考相關(guān)網(wǎng)站:http://www.swiper.com.cn/download/index.html
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jquery中Ajax用法總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注