直接上代码,望君清楚
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | <!DOCTYPE html> < html > < head > < meta charset = "utf-8" > < title >轮播图效果</ title > < meta name = "viewport" content = "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" > <!-- Link Swiper's CSS --> < link rel = "stylesheet" href = "swiper.min.css" > <!-- Demo styles --> < 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: 500px; height: 300px; margin-top: 50px; } .swiper-slide { text-align: center; font-size: 18px; background: #fff; /* Center slide text vertically */ 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 > <!-- Swiper --> < div > < div > < div >Slide 1</ div > < div >Slide 2</ div > < div >Slide 3</ div > < div >Slide 4</ div > < div >Slide 5</ div > < div >Slide 6</ div > < div >Slide 7</ div > < div >Slide 8</ div > < div >Slide 9</ div > < div >Slide 10</ div > </ div > <!-- Add Pagination --> < div ></ div > <!-- Add Arrows --> < div ></ div > < div ></ div > </ div > <!-- Swiper JS --> < script src = "swiper.min.js" ></ script > <!-- Initialize Swiper --> < script > // 可以参考 180嵌套 、190抓手光标 、 200无限循环 、 2403D滚动切换 、 310缩略图/无限循环 // 缩放400 、 虚拟410 、自定义插件420 var swiper = new Swiper('.swiper-container', { spaceBetween: 30, //slide之间的距离 centeredSlides: true, //若为真,那么活动块会居中,而非默认状态下的居左 effect: 'cube', //翻转效果 zoom: true, //缩放图片比例 mousewheel: true, //鼠标滚动可以控制slide替换 autoplay: { //自动切换 delay: 2500, disableOnInteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); </ script > </ body > </ html > |
特别申明:
本站所有资源都是由网友投稿发布,或转载各大下载站,请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:lei1294551502@163.com