1.0.3 • Published 4 years ago

react-seamless-scroll v1.0.3

Weekly downloads
17
License
ISC
Repository
github
Last release
4 years ago

react-seamless-scroll

一个基于 requestAnimationFramereact自动无缝滚动组件!

示例

快速开始


  • npm install react-seamless-scroll -S
  • import react-seamless-scroll from 'react-seamless-scroll';

使用方法


如下props:

OptiondefaultDescription
speed60每秒/px
reversefalse是否逆向滚动
modevertical滚动方向

示例代码

import './index.scss';

import {Icon, Spin} from 'antd';

import React from 'react';
import ReactSeamlessScroll from 'react-seamless-scroll';
import moment from 'moment';

interface IProps {}
const Broadcast = React.memo((props: IProps) => {
  return (
    <ReactSeamlessScroll style={{width: '200px', height: '300px'}}>
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.js</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </ReactSeamlessScroll>
  );
});

export default Broadcast;