seamless-scroll-js
v0.0.7
Published
A JS seamless scroll plug-in
Maintainers
Readme
Language
Browser support
| | | | |:---------:|:---------:|:---------:|:---------:| | IE10+ | ✓| ✓ | ✓ | ✓
Install
npm install seamless-scroll-js --save-devUSE
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|20000ms|Number|
|timingFunction|transition type, see w3c css3 transition timingFunction|linear|String|
|delay|transition delay, see w3c css3 transition delay|0ms|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
