240-effect-coverflow.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Swiper demo</title>
  6. <meta
  7. name="viewport"
  8. content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
  9. />
  10. <!-- Link Swiper's CSS -->
  11. <link
  12. rel="stylesheet"
  13. href="../swiper-bundle.min.css"
  14. />
  15. <!-- Demo styles -->
  16. <style>
  17. html,
  18. body {
  19. position: relative;
  20. height: 100%;
  21. }
  22. body {
  23. background: #eee;
  24. font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  25. font-size: 14px;
  26. color: #000;
  27. margin: 0;
  28. padding: 0;
  29. }
  30. .swiper {
  31. width: 100%;
  32. padding-top: 50px;
  33. padding-bottom: 50px;
  34. }
  35. .swiper-slide {
  36. background-position: center;
  37. background-size: cover;
  38. width: 300px;
  39. height: 300px;
  40. }
  41. .swiper-slide img {
  42. display: block;
  43. width: 100%;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <!-- Swiper -->
  49. <div class="swiper mySwiper">
  50. <div class="swiper-wrapper">
  51. <div class="swiper-slide">
  52. <img src="./images/nature-1.jpg" />
  53. </div>
  54. <div class="swiper-slide">
  55. <img src="./images/nature-2.jpg" />
  56. </div>
  57. <div class="swiper-slide">
  58. <img src="./images/nature-3.jpg" />
  59. </div>
  60. <div class="swiper-slide">
  61. <img src="./images/nature-4.jpg" />
  62. </div>
  63. <div class="swiper-slide">
  64. <img src="./images/nature-5.jpg" />
  65. </div>
  66. <div class="swiper-slide">
  67. <img src="./images/nature-6.jpg" />
  68. </div>
  69. <div class="swiper-slide">
  70. <img src="./images/nature-7.jpg" />
  71. </div>
  72. <div class="swiper-slide">
  73. <img src="./images/nature-8.jpg" />
  74. </div>
  75. <div class="swiper-slide">
  76. <img src="./images/nature-9.jpg" />
  77. </div>
  78. </div>
  79. <div class="swiper-pagination"></div>
  80. </div>
  81. <!-- Swiper JS -->
  82. <script src="../swiper-bundle.min.js"></script>
  83. <!-- Initialize Swiper -->
  84. <script>
  85. var swiper = new Swiper(".mySwiper", {
  86. effect: "coverflow",
  87. grabCursor: true,
  88. centeredSlides: true,
  89. slidesPerView: "auto",
  90. coverflowEffect: {
  91. rotate: 50,
  92. stretch: 0,
  93. depth: 100,
  94. modifier: 1,
  95. slideShadows: true,
  96. },
  97. pagination: {
  98. el: ".swiper-pagination",
  99. },
  100. });
  101. </script>
  102. </body>
  103. </html>