...
|
...
|
@@ -19,7 +19,12 @@ var winH = $(window).height(), |
|
|
num,
|
|
|
url;
|
|
|
|
|
|
///recom/maylikekids
|
|
|
var $curNav,
|
|
|
$navList = $('#maybe-like-nav'),
|
|
|
$goodsList = $('#goods-list'),
|
|
|
$goods = $goodsList.children('.goods-list');
|
|
|
|
|
|
//ajax url
|
|
|
if (kidsType) {
|
|
|
url = '/product/recom/maylikekids';
|
|
|
} else if (lifestyleType) {
|
...
|
...
|
@@ -28,15 +33,37 @@ if (kidsType) { |
|
|
url = '/product/recom/maylike?gender=' + gender;
|
|
|
}
|
|
|
|
|
|
$curNav = $navList.children('.focus');
|
|
|
|
|
|
$('#maybe-like-nav').delegate('li', 'touchstart', function() {
|
|
|
var $this = $(this),
|
|
|
$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({
|
...
|
...
|
|