作者:Ajax | 来源:互联网 | 2023-09-12 13:21
seamless-scrolljs无缝转动插件?简朴demo?EnglishDocument兼容性ie7+不支持挪动端手势。运用constseamlessrequire(seams
seamless-scroll
js无缝转动插件
![《js无缝转动》](https://img.php1.cn/3cd4a/1eebe/cd5/b386c433a16f5497.webp)
兼容性
运用
const seamless = require('seamscroll')
`or`
import seamless from 'seamscroll'
seamless.init({
dom: document.getElementById('demo1')
})
//script tag
Demo
.demo2 {
width: 600px;
height: 100px;
position: relative;
overflow: hidden;
margin-top: 100px;
}
.list2 li {
float: left;
width: 100px;
height: 100px;
margin-right: 20px;
text-align: center;
font-size: 20px;
color: #fff;
line-height:100px;
background-color: #ccc;
}
seamscroll.init({
dom: document.getElementById('demo2'),
direction: 2
})
设置参数
*必填参数(dom)
key | description | default | val |
---|
*dom | 作用的dom | null | dom |
step | 步长,越大越快 | 1 | Number |
hoverStop | 是不是启用鼠标hover掌握 | true | Boolean |
direction | 方向 0 往下 1 往上 2向左 3向右 | 1 | Number |
singleHeight | 单步活动住手的高度(默认值0是无缝不住手的转动) direction => 0/1 | 0 | Number |
singleWidth | 单步活动住手的宽度(默认值0是无缝不住手的转动) direction => 2/3 | 0 | Number |
waitTime | 单步住手等待时间(default 1s) | 1000 | Number |
TKS
seamless-scroll发明bug或许有什么不足望指导,觉得不错点个star吧。
License
seamless-scroll is open source and released under the MIT License.