|
|
var $ = require('yoho-jquery'),
|
|
|
Swiper = require('yoho-swiper2');
|
|
|
|
|
|
var bannerSwiper,
|
|
|
categoryHeight = $('.tab-box').height(),
|
|
|
var categoryHeight = $('.tab-box').height(),
|
|
|
gender,
|
|
|
isBrand;
|
|
|
|
...
|
...
|
@@ -16,7 +15,25 @@ function channels(key) { |
|
|
'women': 2,
|
|
|
'lifestyle': 4
|
|
|
}[key];
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function initialize() {
|
|
|
$('.banner-swiper').each(function() {
|
|
|
if ($(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
|
|
|
new Swiper(this, {
|
|
|
preloadImages: false,
|
|
|
lazyLoading: true,
|
|
|
lazyLoadingInPrevNext: true,
|
|
|
lazyLoadingOnTransitionStart: true,
|
|
|
loop: true,
|
|
|
autoplay: 3000,
|
|
|
autoplayDisableOnInteraction: false,
|
|
|
paginationClickable: true,
|
|
|
slideElement: 'li'
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function loadData(channel, isBrand) {
|
|
|
var preUrl;
|
...
|
...
|
@@ -38,19 +55,21 @@ function loadData(channel, isBrand) { |
|
|
$('.brand-content').html(data);
|
|
|
} else {
|
|
|
$('.category-content').html(data);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
initialize();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.channel-tab').find('li').click(function() {
|
|
|
gender = $(this).find('span').text().replace(/[^A-Za-z]+/g, '').toLowerCase(),
|
|
|
gender = $(this).find('span').text().replace(/[^A-Za-z]+/g, '').toLowerCase();
|
|
|
isBrand = $('.brand-tab').find('.brand').hasClass('active');
|
|
|
|
|
|
$(this).addClass('focus').siblings().removeClass('focus');
|
|
|
|
|
|
loadData(channels(gender), isBrand);
|
|
|
})
|
|
|
});
|
|
|
|
|
|
// 点击字母,页面滚动到相关区域
|
|
|
$intercept.click(function() {
|
...
|
...
|
@@ -75,21 +94,7 @@ $('.brand-tab').find('li').click(function() { |
|
|
$('.cate-cha').removeClass('hide').siblings().addClass('hide');
|
|
|
}
|
|
|
|
|
|
$('.banner-swiper').each(function() {
|
|
|
if ($(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
|
|
|
new Swiper(this, {
|
|
|
preloadImages: false,
|
|
|
lazyLoading: true,
|
|
|
lazyLoadingInPrevNext: true,
|
|
|
lazyLoadingOnTransitionStart: true,
|
|
|
loop: true,
|
|
|
autoplay: 3000,
|
|
|
autoplayDisableOnInteraction: false,
|
|
|
paginationClickable: true,
|
|
|
slideElement: 'li'
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
initialize();
|
|
|
});
|
|
|
|
|
|
$(function() {
|
...
|
...
|
|