Showing
1 changed file
with
8 additions
and
11 deletions
@@ -37,12 +37,13 @@ exports.init = function() { | @@ -37,12 +37,13 @@ exports.init = function() { | ||
37 | 37 | ||
38 | //文字截取 | 38 | //文字截取 |
39 | ellipsis.init(); | 39 | ellipsis.init(); |
40 | - setTimeout(function(){ | 40 | + setTimeout(function() { |
41 | $intro.mlellipsis(4); //品牌介绍 | 41 | $intro.mlellipsis(4); //品牌介绍 |
42 | - $('.info-block-content').each(function(){ //相关文章 | 42 | + $('.info-block-content').each(function() { //相关文章 |
43 | $(this).mlellipsis(2); | 43 | $(this).mlellipsis(2); |
44 | }); | 44 | }); |
45 | - },0) | 45 | + }, 0); |
46 | + | ||
46 | //lazyload | 47 | //lazyload |
47 | $('img.lazy').lazyload(); | 48 | $('img.lazy').lazyload(); |
48 | 49 | ||
@@ -72,14 +73,7 @@ exports.init = function() { | @@ -72,14 +73,7 @@ exports.init = function() { | ||
72 | 73 | ||
73 | if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) { | 74 | if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) { |
74 | //loadData | 75 | //loadData |
75 | - if (dataEnd) { | ||
76 | - //下次下拉时不显示加载图片以及不加载数据 | ||
77 | - $loading.addClass('hide'); | ||
78 | - $noMore.removeClass('hide'); | ||
79 | - } else { | ||
80 | - $loading.removeClass('hide'); | ||
81 | - $noMore.addClass('hide') | ||
82 | - | 76 | + if (!dataEnd) { |
83 | count = $infoContent.children('.info-block').length; | 77 | count = $infoContent.children('.info-block').length; |
84 | canScroll = false; | 78 | canScroll = false; |
85 | $.ajax({ | 79 | $.ajax({ |
@@ -95,6 +89,9 @@ exports.init = function() { | @@ -95,6 +89,9 @@ exports.init = function() { | ||
95 | if (data.success) { | 89 | if (data.success) { |
96 | if (data.end) { | 90 | if (data.end) { |
97 | dataEnd = true; | 91 | dataEnd = true; |
92 | + | ||
93 | + $loading.addClass('hide'); | ||
94 | + $noMore.removeClass('hide'); | ||
98 | } | 95 | } |
99 | res = data.data; | 96 | res = data.data; |
100 | for (i = 0; i < res.length; i++) { | 97 | for (i = 0; i < res.length; i++) { |
-
Please register or login to post a comment