您好,登錄后才能下訂單哦!
前言
Swiper是純javascript打造的滑動特效插件,面向手機、平板電腦等移動終端。Swiper能實現(xiàn)觸屏焦點圖、觸屏Tab切換、觸屏多圖切換等常用效果。Swiper開源、免費、穩(wěn)定、使用簡單、功能強大,是架構(gòu)移動終端網(wǎng)站的重要選擇!
本文詳細的給大家介紹了關(guān)于JS用swiper實現(xiàn)3d翻轉(zhuǎn)幻燈片的相關(guān)內(nèi)容,分享出來供大家參考學(xué)習(xí),下面話不多說了,來一起看看詳細的介紹吧。
先上效果圖
使用的是swiper3.0版本coverflow效果,源碼如下
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="utf-8"> <title>Swiper demo</title> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <!-- Link Swiper's CSS --> <link href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css" rel="external nofollow" rel="stylesheet"> <!-- Demo styles --> <style> body { background: #fff; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #000; margin: 0; padding: 0; } .swiper-container { width: 100%; padding-top: 50px; padding-bottom: 50px; } .swiper-slide { background-position: center; background-size: cover; height: 170px; width: 130px!important; } </style> </head> <body> <!-- Swiper --> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> <div class="swiper-slide" ></div> </div> <!-- Add Pagination --> <div class="swiper-pagination"></div> </div> <!-- Swiper JS --> <script src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.js"></script> <script src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.js"></script> <!-- Initialize Swiper --> <script> var mySwiper = new Swiper('.swiper-container', { effect: 'coverflow', slidesPerView: 2, centeredSlides: true, coverflow: { rotate: 0, stretch: 30, depth: 400, modifier: 1, slideShadows: true } }) </script> </body> </html>
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對億速云的支持。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。