【问题标题】:Having Issue with react-slick. Swipe on mobile not workingreact-slick 有问题。在手机上滑动不起作用
【发布时间】:2019-11-29 16:07:54
【问题描述】:

我遇到了 react-slick 的问题。我需要让它在移动设备上“滑动”。不幸的是,我在文档中找到的 swipeToSlide: true, 似乎不起作用。

有什么解决办法吗?

这是我的设置代码示例:

const settings = {
      dots: true,
      arrows: false,
      fade: true,
      swipeToSlide: false,
      infinite: false,
      slidesToShow: 1,
      slidesToScroll: 1,
      adaptiveHeight: true,
      speed: 200,
      customPaging(i) {
        return (
          <button
            className={`${questions[i].answer && 'active'}`}
            type="button"
          />
        );
      },
      responsive: [
        {
          breakpoint: theme.media.tablet,
          settings: {
            swipeToSlide: true
          }
        }
      ],
      beforeChange: (previous, next) =>
        this.setState({ oldSlide: previous, activeSlide: next }),
      afterChange: previous => this.setState({ activeSlide2: previous })
    };

【问题讨论】:

    标签: swipe react-slick


    【解决方案1】:

    如果您将 fade: true 设置为 fade: false 它应该可以工作

    【讨论】:

      猜你喜欢
      • 2022-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 2015-10-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多