1

如何锁定轮播并防止可变宽度幻灯片末尾的空白区域?

示例图像

示例代码:

var ReactSlickDemo = React.createClass({
  render: function() {
    var settings = {
        infinite: false,
        swipeToSlide: true,
        variableWidth: true,
    }
    return (
        <div className='container'>
        <Slider {...settings}>
            <div className="item">ITEM1</div>
          <div className="item">ITEM 2</div>
          <div className="item">ITEM 3</div>
          <div className="item">ITEM 4</div>
          <div className="item">ITEM 5</div>
          <div className="item">ITEM 6</div>
        </Slider>
      </div>
    );
  }
});

ReactDOM.render(
  <ReactSlickDemo />,
  document.getElementById('container')
);
4

0 回答 0