A lightweight scroll for touch device. 高性能的无线滚动组件
Live demo: http://yuanzhaohao.github.io/yscroll/
To build the examples locally, run:
npm install
gulp server
Then your example(localhost:3000/demo/) will open automatically in browser.
new YScroll('.scroll-nav');
new YScroll('.fs-2', {
distance: 220, \\ 每一帧滑动的距离
bounceTime: 300, \\ 滑动动画时间transitionDuration
ease: 'quadratic' \\ 滑动效果选项 'quadratic' || 'circular' || 'back' || 'elastic'
});
new YScroll('.fs-3', {
distance: 220,
cssAnimation: false
});
new YScroll('.scroll-nav-1', {
cssAnimation: false
});
var srcoll = new YScroll('.scroll-nav');
scroll.scroller.addEventListener('sTouchstart', function (e) {
console.log('call sTouchstart');
}, false);
var snap = new YScroll('.fs-3', {
distance: 220
});
snap.scroller.addEventListener('sPointmove', function (e) {
console.log('call sTouchstart');
}, false);