|
@@ -14,12 +14,12 @@ var ListData = function(opt) { |
|
@@ -14,12 +14,12 @@ var ListData = function(opt) { |
14
|
var self = this;
|
14
|
var self = this;
|
15
|
|
15
|
|
16
|
var _scrollHandler = function() {
|
16
|
var _scrollHandler = function() {
|
17
|
- var curScrollTop = $(window).scrollTop();
|
17
|
+ var curScrollTop = this.opt.y || $(window).scrollTop();
|
18
|
|
18
|
|
19
|
// 当scroll到1/4$repayList高度后继续请求下一页数据
|
19
|
// 当scroll到1/4$repayList高度后继续请求下一页数据
|
20
|
if (curScrollTop > this.opt.previousScrollTop &&
|
20
|
if (curScrollTop > this.opt.previousScrollTop &&
|
21
|
(curScrollTop + this.opt.winH >
|
21
|
(curScrollTop + this.opt.winH >
|
22
|
- $(document).height() - 0.25 * this.opt.boxArea.height() - 50)) {
|
22
|
+ this.opt.docH - 0.25 * this.opt.boxArea.height() - 50)) {
|
23
|
this.getListData();
|
23
|
this.getListData();
|
24
|
}
|
24
|
}
|
25
|
|
25
|
|
|
@@ -32,7 +32,18 @@ var ListData = function(opt) { |
|
@@ -32,7 +32,18 @@ var ListData = function(opt) { |
32
|
previousScrollTop: 0
|
32
|
previousScrollTop: 0
|
33
|
}, opt);
|
33
|
}, opt);
|
34
|
|
34
|
|
35
|
- $(window).scroll(function() {
|
35
|
+ $(window).scroll(function(event, y, docH, starIScroll) {
|
|
|
36
|
+ if (!y && $('.is-open').val() === 'true') {
|
|
|
37
|
+ return;
|
|
|
38
|
+ }
|
|
|
39
|
+
|
|
|
40
|
+ if (y) {
|
|
|
41
|
+ self.opt.y = Math.abs(y);
|
|
|
42
|
+ self.opt.starIScroll = starIScroll;
|
|
|
43
|
+ }
|
|
|
44
|
+
|
|
|
45
|
+ self.opt.docH = docH ? docH : $(document).height();
|
|
|
46
|
+
|
36
|
window.requestAnimationFrame(_scrollHandler.bind(self));
|
47
|
window.requestAnimationFrame(_scrollHandler.bind(self));
|
37
|
});
|
48
|
});
|
38
|
};
|
49
|
};
|
|
@@ -103,6 +114,10 @@ ListData.prototype.getListData = function(page) { |
|
@@ -103,6 +114,10 @@ ListData.prototype.getListData = function(page) { |
103
|
});
|
114
|
});
|
104
|
}
|
115
|
}
|
105
|
|
116
|
|
|
|
117
|
+ if (self.opt.starIScroll) {
|
|
|
118
|
+ self.opt.starIScroll.iScroll.refresh();
|
|
|
119
|
+ }
|
|
|
120
|
+
|
106
|
loading.hideLoadingMask();
|
121
|
loading.hideLoadingMask();
|
107
|
},
|
122
|
},
|
108
|
error: function() {
|
123
|
error: function() {
|