Authored by xuqi

guang infos load

@@ -15,8 +15,7 @@ var $loadMoreInfo = $('#load-more-info'); @@ -15,8 +15,7 @@ var $loadMoreInfo = $('#load-more-info');
15 var $loading = $(''), 15 var $loading = $(''),
16 $noMore = $(''); 16 $noMore = $('');
17 17
18 -var winH = $(window).height(),  
19 - loadMoreH = $loadMoreInfo.height(); 18 +var winH = $(window).height();
20 19
21 var $infoList = $('#info-list'), 20 var $infoList = $('#info-list'),
22 $infos = $infoList.children('.info-list'), 21 $infos = $infoList.children('.info-list'),
@@ -107,7 +106,9 @@ navHammer.on('tap', function(e) { @@ -107,7 +106,9 @@ navHammer.on('tap', function(e) {
107 }); 106 });
108 107
109 $(document).scroll(function() { 108 $(document).scroll(function() {
110 - if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {  
111 - loadMore($infos.not('.hide'), state[curType]); 109 + var $c = $infos.not('.hide');
  110 +
  111 + if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $c.height()) {
  112 + loadMore($c, state[curType]);
112 } 113 }
113 }); 114 });
@@ -9,8 +9,7 @@ var $ = require('jquery'); @@ -9,8 +9,7 @@ var $ = require('jquery');
9 var info = require('./info'), 9 var info = require('./info'),
10 loadMore = info.loadMore; 10 loadMore = info.loadMore;
11 11
12 -var winH = $(window).height(),  
13 - loadMoreH = $('#load-more').height(); 12 +var winH = $(window).height();
14 13
15 var $author = $('#author-infos'); 14 var $author = $('#author-infos');
16 var $tag = $('#tag'); 15 var $tag = $('#tag');
@@ -41,9 +40,7 @@ if ($tag.length > 0) { @@ -41,9 +40,7 @@ if ($tag.length > 0) {
41 } 40 }
42 41
43 $(document).scroll(function() { 42 $(document).scroll(function() {
44 -  
45 - //设置50px阈值  
46 - if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { 43 + if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infos.height()) {
47 loadMore($infos, setting); 44 loadMore($infos, setting);
48 } 45 }
49 }); 46 });