list.js 559 Bytes
/**
 * 列表页,编辑页
 * @author: xuqi<qi.xu@yoho.cn>
 * @date: 2015/10/10
 */

var $ = require('yoho.zepto');

var info = require('./info'),
    loadMore = info.loadMore;

var winH = $(window).height(),
    loadMoreH = $('#load-more').height();

var setting = {
    page: 1,
    end: false
};

var $infos = $('#info-list');

info.initInfosEvt($infos);

$(document).scroll(function() {
    if (setting.end) {
        return;
    }

    if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
        loadMore($infos, setting);
    }
});