0.0.7 • Published 5 years ago
seamless-scroll-js v0.0.7
Language
Browser support
IE10+ | ✓ | ✓ | ✓ | ✓ |
Install
npm install seamless-scroll-js --save-dev
USE
react, vue
import "seamless-scroll-js"
...
const dom = document.getElementById("dom");
dom.SeamlessScroll([options]);
html
Index.js in the project
<script src="./index.js"></script>
const dom = document.getElementById("dom");
dom.SeamlessScroll([options]);
API
.SeamlessScroll(options)
init
options
key | description | default | type |
---|---|---|---|
direction | top、bottom、left、right | top | String |
duration | animation duration | 20000 ms | Number |
timingFunction | transition type, see w3c css3 transition timingFunction | linear | String |
delay | transition delay, see w3c css3 transition delay | 0 ms | Number |
autoPlay | whether to play automatically | true | Boolean |
.play()
Start scroll
.onScrollStart {function}
Callback function before each roll starts
.onScrollStart {function}
Callback function after each round of rolling ends