Authored by 梁志锋

update

framework @ 119c247f
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
... ...
... ... @@ -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({
... ...