我的測試程式碼:
var myScroll = new IScroll("#wrapper", {
probeType: 2,
preventDefault: false,
interactiveScrollbars: true,
useTransform: true
});
var scrollF = function() {
console.log(this.y, this.maxScrollY, "scroll");
}
var scrollEndF = function() {
console.log(this.y, this.maxScrollY, "scrollEnd");
}
myScroll.on('scroll', scrollF);
myScroll.on('scrollEnd', scrollEndF)
發現每次捲動的時候印出結果為:
#具體渲染內容:
內部的li是後面異步加上去的