400-zoom.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. body {
  31. background: #000;
  32. }
  33. .swiper {
  34. width: 100%;
  35. height: 100%;
  36. }
  37. .swiper-slide {
  38. overflow: hidden;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <!-- Swiper -->
  44. <div
  45. style="--swiper-navigation-color: #fff; --swiper-pagination-color: #fff"
  46. class="swiper mySwiper"
  47. >
  48. <div class="swiper-wrapper">
  49. <div class="swiper-slide">
  50. <div class="swiper-zoom-container">
  51. <img src="./images/nature-1.jpg" />
  52. </div>
  53. </div>
  54. <div class="swiper-slide">
  55. <div class="swiper-zoom-container">
  56. <img src="./images/nature-2.jpg" />
  57. </div>
  58. </div>
  59. <div class="swiper-slide">
  60. <div class="swiper-zoom-container">
  61. <img src="./images/nature-3.jpg" />
  62. </div>
  63. </div>
  64. <div class="swiper-slide">
  65. <div class="swiper-zoom-container">
  66. <img src="./images/nature-4.jpg" />
  67. </div>
  68. </div>
  69. <div class="swiper-slide">
  70. <div class="swiper-zoom-container">
  71. <img src="./images/nature-5.jpg" />
  72. </div>
  73. </div>
  74. <div class="swiper-slide">
  75. <div class="swiper-zoom-container">
  76. <img src="./images/nature-6.jpg" />
  77. </div>
  78. </div>
  79. <div class="swiper-slide">
  80. <div class="swiper-zoom-container">
  81. <img src="./images/nature-7.jpg" />
  82. </div>
  83. </div>
  84. <div class="swiper-slide">
  85. <div class="swiper-zoom-container">
  86. <img src="./images/nature-8.jpg" />
  87. </div>
  88. </div>
  89. <div class="swiper-slide">
  90. <div class="swiper-zoom-container">
  91. <img src="./images/nature-9.jpg" />
  92. </div>
  93. </div>
  94. </div>
  95. <div class="swiper-button-next"></div>
  96. <div class="swiper-button-prev"></div>
  97. <div class="swiper-pagination"></div>
  98. </div>
  99. <!-- Swiper JS -->
  100. <script src="../swiper-bundle.min.js"></script>
  101. <!-- Initialize Swiper -->
  102. <script>
  103. var swiper = new Swiper(".mySwiper", {
  104. zoom: true,
  105. navigation: {
  106. nextEl: ".swiper-button-next",
  107. prevEl: ".swiper-button-prev",
  108. },
  109. pagination: {
  110. el: ".swiper-pagination",
  111. clickable: true,
  112. },
  113. });
  114. </script>
  115. </body>
  116. </html>