收藏
回答

swiper 是否支持反方向滚动?

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 需求 Swiper 客户端 6.7.3 2.3.0

- 需求的场景描述(希望解决的问题)


小程序支持反方向滚动


- 希望提供的能力


默认的 autoplay 是从左到右滚动,能否支持从右往左滚动

回答关注问题邀请回答
收藏

3 个回答

  • 晨
    2018-11-13

    需求场景是怎样的,要实现什么功能?

    2018-11-13
    有用
    回复 1
    • 2018-11-13

      类似陈列墙,有的 swiper 是从左到右滚动,有的 swiper 是从右到左滚动

      2018-11-13
      回复
  • 王增迪
    王增迪
    2021-08-14

    外层 swiper 容器旋转 180 度, 内层 swiper-item 在旋转 180 度即可实现反向滚动。亲测可用。

    <swiper
      class="swiper-container"
      circular="{{true}}"
      autoplay="{{true}}"
      bindanimationfinish="animationFinish"
      interval="2000"
    >
      <swiper-item wx:for="{{list}}" class="swiper-item-container" wx:key="index">
        <view class="swiper-item">
          <image class="avatar" src="{{item.profileUrl}}"></image>
        </view>
      </swiper-item>
    </swiper>
    
    .swiper-container {
      transform: rotate(180deg);
      // ...
    }
    
    
    .swiper-item {
      transform: rotate(180deg);
      // ...
    }
    
    2021-08-14
    有用 2
    回复 1
    • 高祥
      高祥
      2022-10-21
      翻转后 滑动时间也会反转
      2022-10-21
      回复
  • 卢霄霄
    卢霄霄
    2018-11-12

    啧啧。。你咋这么妖娆。。关了autoplay,自己setTimeout或者interval来设置current吧

    2018-11-12
    有用
    回复
登录 后发表内容