swiper.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Presta - Free Bootstrap Bike Repair Template</title>
  7. <meta name="description" content="Presta is a Free Bootstrap Bike Repair Template.">
  8. <!-- Favicon and Touch Icons -->
  9. <link rel="stylesheet" href="{dreamer-cms:template /}assets/css/swiper-bundle.min.css">
  10. <style>
  11. @media (min-width:768px) {
  12. .swiper {
  13. --swiper-navigation-size: 50px;
  14. --swiper-navigation-sides-offset: 20px;
  15. }
  16. }
  17. @media (max-width:769px) {
  18. .swiper {
  19. --swiper-navigation-size: 25px;
  20. --swiper-navigation-sides-offset: 20px;
  21. }
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <section class="pt-1 pt-md-3 pt-xl-1">
  27. <div class="" style="overflow: hidden;">
  28. <div class="row gx-0">
  29. <div class="swiper bsb-hero-pro-5-swiper" style=" --swiper-theme-color: #a9afb487;padding: 0;">
  30. <div class="swiper-wrapper">
  31. <!-- Slides -->
  32. {dreamer-cms:list typeid="9jdjs0s8" pagenum="0" pagesize="3" flag="p"}
  33. <div class="swiper-slide">
  34. <a href="#">
  35. <img data-src="[field:litpic /]" alt="[field:title /]" style="width: 100%;height: auto;">
  36. </a>
  37. </div>
  38. {/dreamer-cms:list}
  39. </div>
  40. <div class="swiper-pagination"></div>
  41. <!-- <div>
  42. <div class="swiper-button-prev"></div>
  43. <div class="swiper-button-next"></div>
  44. </div> -->
  45. </div>
  46. </div>
  47. </div>
  48. </section>
  49. <script src="{dreamer-cms:template /}assets/js/swiper-bundle.min.js"></script>
  50. <script>
  51. var mySwiper = new Swiper('.swiper', {
  52. // direction: 'vertical', // 垂直切换选项
  53. autoplay: true,
  54. loop: true, // 循环模式选项
  55. // 如果需要分页器
  56. pagination: {
  57. el: '.swiper-pagination',
  58. clickable: true
  59. },
  60. // 如果需要前进后退按钮
  61. //navigation: {
  62. //nextEl: '.swiper-button-next',
  63. //prevEl: '.swiper-button-prev',
  64. //},
  65. // 如果需要滚动条
  66. scrollbar: {
  67. el: '.swiper-scrollbar',
  68. },
  69. })
  70. </script>
  71. </body>
  72. </html>