090-vertical.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. height: 100%;
  33. }
  34. .swiper-slide {
  35. text-align: center;
  36. font-size: 18px;
  37. background: #fff;
  38. /* Center slide text vertically */
  39. display: -webkit-box;
  40. display: -ms-flexbox;
  41. display: -webkit-flex;
  42. display: flex;
  43. -webkit-box-pack: center;
  44. -ms-flex-pack: center;
  45. -webkit-justify-content: center;
  46. justify-content: center;
  47. -webkit-box-align: center;
  48. -ms-flex-align: center;
  49. -webkit-align-items: center;
  50. align-items: center;
  51. }
  52. .swiper-slide img {
  53. display: block;
  54. width: 100%;
  55. height: 100%;
  56. object-fit: cover;
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <!-- Swiper -->
  62. <div class="swiper mySwiper">
  63. <div class="swiper-wrapper">
  64. <div class="swiper-slide">Slide 1</div>
  65. <div class="swiper-slide">Slide 2</div>
  66. <div class="swiper-slide">Slide 3</div>
  67. <div class="swiper-slide">Slide 4</div>
  68. <div class="swiper-slide">Slide 5</div>
  69. <div class="swiper-slide">Slide 6</div>
  70. <div class="swiper-slide">Slide 7</div>
  71. <div class="swiper-slide">Slide 8</div>
  72. <div class="swiper-slide">Slide 9</div>
  73. </div>
  74. <div class="swiper-pagination"></div>
  75. </div>
  76. <!-- Swiper JS -->
  77. <script src="../swiper-bundle.min.js"></script>
  78. <!-- Initialize Swiper -->
  79. <script>
  80. var swiper = new Swiper(".mySwiper", {
  81. direction: "vertical",
  82. pagination: {
  83. el: ".swiper-pagination",
  84. clickable: true,
  85. },
  86. });
  87. </script>
  88. </body>
  89. </html>