list.js
889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* 列表页,编辑页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require('jquery');
var info = require('./info'),
loadMore = info.loadMore;
var winH = $(window).height(),
loadMoreH = $('#load-more').height();
var $author = $('#author-infos');
var $tag = $('#tag');
var $gender = $('#gender');
var $isApp = $('#isApp');
var setting = {
page: 2,
end: false
};
var $infos = $('#info-list');
info.initInfosEvt($infos);
if ($author.length > 0) {
$.extend(setting, {
authorId: $author.data('id')
});
}
if ($tag.length > 0) {
$.extend(setting, {
tag: $tag.val(),
gender: $gender.val(),
isApp: $isApp.val()
});
}
$(document).scroll(function() {
//设置50px阈值
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {
loadMore($infos, setting);
}
});