Authored by xuqi

guang loading

... ... @@ -73,18 +73,20 @@ navHammer.on('tap', function(e) {
$this.addClass('focus');
$curNav.removeClass('focus');
$infos.not('.hide').addClass('hide');
$content = $infos.eq(index);
$content.removeClass('hide');
$curNav = $this;
curType = $this.data('type');
//当未加载数据时去请求数据
if (state[curType].page === 1) {
//无数据时隐藏正在加载和没有更多字样
$loading.addClass('hide');
$noMore.addClass('hide');
loadMore($content, state[curType]);
}
} else {
//重置当前Tab的load-more
if (state[curType].end) {
... ... @@ -94,6 +96,14 @@ navHammer.on('tap', function(e) {
$loading.removeClass('hide');
$noMore.addClass('hide');
}
}
$infos.not('.hide').addClass('hide');
$content.removeClass('hide');
if (state[curType].page === 1) {
window.rePosFooter();//进入空内容时重新定位footer位置
}
});
$(document).scroll(function() {
... ...
... ... @@ -128,6 +128,7 @@ function loadMore($container, opt) {
return;
}
$container.append(data);
if (num > 0) {
... ... @@ -140,6 +141,10 @@ function loadMore($container, opt) {
if (opt.page === 1) {
loading.hideLoadingMask();
$loading.removeClass('hide');//显示空屏加载时hide的隐藏
window.rePosFooter();//插入内容后重新计算底部位置
}
opt.page++;
... ...
.loading-mask {
position: absolute;
position: fixed;
background: rgba(0,0,0,.1);
top: 0;
bottom: 0;
... ...
... ... @@ -37,7 +37,7 @@
<div id="info-list" class="info-list-container">
{{# infos}}
<div class="info-list {{^show}}hide{{/show}}">
<div class="info-list{{^show}} hide{{/show}}">
{{# info}}
{{> guang/info}}
{{/ info}}
... ...