Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

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