1.4.3 • Published 7 years ago

skroll v1.4.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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
iscrolltest-iscroll.html?size=10000&content=0&method=iscroll
原生test-native.html?size=10000&content=0&method=native

License

MIT

Copyright (c) 2016-present, shenfe

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago