250-effect-flip.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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: 300px;
  32. height: 300px;
  33. padding: 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>
  70. <div class="swiper-button-next"></div>
  71. <div class="swiper-button-prev"></div>
  72. <div class="swiper-pagination"></div>
  73. </div>
  74. <!-- Swiper JS -->
  75. <script src="../swiper-bundle.min.js"></script>
  76. <!-- Initialize Swiper -->
  77. <script>
  78. var swiper = new Swiper(".mySwiper", {
  79. effect: "flip",
  80. grabCursor: true,
  81. pagination: {
  82. el: ".swiper-pagination",
  83. },
  84. navigation: {
  85. nextEl: ".swiper-button-next",
  86. prevEl: ".swiper-button-prev",
  87. },
  88. });
  89. </script>
  90. </body>
  91. </html>