jQuery自适应轮播图插件Swiper用法示例
本文实例讲述了jQuery自适应轮播图插件Swiper用法。分享给大家供大家参考,具体如下:
运行效果截图如下:
示例代码如下:
<!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自适应模板</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>
关于swiper的内容读者可参考相关网站:http://www.swiper.com.cn/download/index.html
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery拖拽特效与技巧总结》、《jQuery表格(table)操作技巧汇总》、《jquery中Ajax用法总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。
相关推荐
如狼 2020-08-15
csstpeixun 2020-08-07
anyushan 2020-06-30
zego实时音视频 2020-06-23
oKeYue 2020-06-14
xiaoxiaokeke 2020-05-19
AlisaClass 2020-05-16
Justdoit00 2020-04-26
rionchen 2020-04-09
86384798 2020-04-04
贤冰 2020-03-08
云端漂移 2020-03-05
数据与算法之美 2020-01-23
yuanran0 2019-12-25
CaiKanXP 2019-12-21