skroll

1.4.3 • Public • Published

skroll

gzip size downloads license

手动实现适用于移动端的滚动。

Demo

Demo

Usage

在需要滚动的元素ready后,即可调用Skroll实现滚动。

// <div style="position:relative;overflow:hidden;">
//     <div id="target" style="position:relative;"></div>
// </div>
new Skroll(document.getElementById('target'), {
    acceleration: 2000,     // deceleration of the sliding target in fact
    maxSpeed: 4000,         // maximum speed of the target
    itemHeightFixed: false, // false (default): no matter what children are like; true: optimized if the target's each child is of a fixed height
    scrollBarMode: 1        // 0: hidden; 1 (default): auto; 1: visible
});

Compatibility

适用于移动端。

Testing

自动隐藏与否对比

方式 测试链接
自动隐藏 test-skroll.html?size=1000&content=1
不隐藏 test-skroll.html?size=1000&content=1&hide=false

不同滚动对比

方式 测试链接
高度固定自动隐藏模拟滚动 test-skroll.html?size=10000&content=0&height=true
高度固定不隐藏模拟滚动 test-skroll.html?size=10000&content=0&height=true&hide=false
iscroll test-iscroll.html?size=10000&content=0&method=iscroll
原生 test-native.html?size=10000&content=0&method=native

License

MIT

Copyright (c) 2016-present, shenfe

Readme

Keywords

Package Sidebar

Install

npm i skroll

Weekly Downloads

20

Version

1.4.3

License

MIT

Last publish

Collaborators

  • hengwu