...
|
...
|
@@ -19,7 +19,11 @@ var winH = $(window).height(), |
|
|
num,
|
|
|
url;
|
|
|
|
|
|
///recom/maylikekids
|
|
|
var $curNav,
|
|
|
index,
|
|
|
$navList = $('#maybe-like-nav');
|
|
|
|
|
|
//ajax url
|
|
|
if (kidsType) {
|
|
|
url = '/product/recom/maylikekids';
|
|
|
} else if (lifestyleType) {
|
...
|
...
|
@@ -28,15 +32,38 @@ if (kidsType) { |
|
|
url = '/product/recom/maylike?gender=' + gender;
|
|
|
}
|
|
|
|
|
|
$curNav = $navList.children('.focus');
|
|
|
|
|
|
$('#maybe-like-nav').delegate('li', 'touchstart', function() {
|
|
|
var $this = $(this),
|
|
|
$goods = $('.goods-list'),
|
|
|
$content;
|
|
|
|
|
|
|
|
|
if ($this.hasClass('focus')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
index = $this.index();
|
|
|
|
|
|
$this.addClass('focus');
|
|
|
$curNav.removeClass('focus');
|
|
|
|
|
|
$goods.not('.hide').addClass('hide');
|
|
|
$content = $goods.eq(index);
|
|
|
$content.removeClass('hide');
|
|
|
|
|
|
$curNav = $this;
|
|
|
|
|
|
$(document).trigger('scroll'); //Trigger lazyLoad
|
|
|
});
|
|
|
|
|
|
//srcoll to load more
|
|
|
$(window).scroll(function () {
|
|
|
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
|
|
|
|
|
|
// 没数据了,就不再加载
|
|
|
if (loading) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
loading = true;
|
|
|
num = $goodList.children('.good-info').length;
|
|
|
$.ajax({
|
...
|
...
|
@@ -50,7 +77,6 @@ $(window).scroll(function () { |
|
|
loading = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$goodList.append(data);
|
|
|
|
|
|
//lazyLoad
|
...
|
...
|
|