Swiper幻灯片设置图片自动高度的方法

  • 配置项

    • 在Swiper配置中添加autoHeight: true
  • 示例代码

    var swiper = new Swiper('.swiper-container', {
      autoHeight: true,
      // 其他配置项
    });
    注意事项
    • 低版本的Swiper不支持autoHeight配置,建议使用Swiper 4.5.0及以上版本。
posted @ 2024-11-29 08:39  黄文Rex  阅读(77)  评论(0)    收藏  举报