...
|
...
|
@@ -14,12 +14,12 @@ var ListData = function(opt) { |
|
|
var self = this;
|
|
|
|
|
|
var _scrollHandler = function() {
|
|
|
var curScrollTop = $(window).scrollTop();
|
|
|
var curScrollTop = this.opt.y || $(window).scrollTop();
|
|
|
|
|
|
// 当scroll到1/4$repayList高度后继续请求下一页数据
|
|
|
if (curScrollTop > this.opt.previousScrollTop &&
|
|
|
(curScrollTop + this.opt.winH >
|
|
|
$(document).height() - 0.25 * this.opt.boxArea.height() - 50)) {
|
|
|
this.opt.docH - 0.25 * this.opt.boxArea.height() - 50)) {
|
|
|
this.getListData();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -32,7 +32,18 @@ var ListData = function(opt) { |
|
|
previousScrollTop: 0
|
|
|
}, opt);
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
$(window).scroll(function(event, y, docH, starIScroll) {
|
|
|
if (!y && $('.is-open').val() === 'true') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (y) {
|
|
|
self.opt.y = Math.abs(y);
|
|
|
self.opt.starIScroll = starIScroll;
|
|
|
}
|
|
|
|
|
|
self.opt.docH = docH ? docH : $(document).height();
|
|
|
|
|
|
window.requestAnimationFrame(_scrollHandler.bind(self));
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -103,6 +114,10 @@ ListData.prototype.getListData = function(page) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
if (self.opt.starIScroll) {
|
|
|
self.opt.starIScroll.iScroll.refresh();
|
|
|
}
|
|
|
|
|
|
loading.hideLoadingMask();
|
|
|
},
|
|
|
error: function() {
|
...
|
...
|
|