...
|
...
|
@@ -6,7 +6,14 @@ var categoryHeight = $('.tab-box').height(), |
|
|
|
|
|
var $intercept = $('.no-intercept'),
|
|
|
$list = $('.brand-list-box'),
|
|
|
$listBox = $('.list-box');
|
|
|
$listBox = $('.list-box'),
|
|
|
$brandContent = $('.brand-content'),
|
|
|
$tabBox = $('.tab-box'),
|
|
|
$contentIndex = $('.content-index'),
|
|
|
$categoryNav = $('.category-nav'),
|
|
|
$channelTab = $('.channel-tab'),
|
|
|
$categoryContent = $('.category-content'),
|
|
|
$brandCha = $('.brand-cha');
|
|
|
|
|
|
require('../common');
|
|
|
require('./brand-cate/cate-all');
|
...
|
...
|
@@ -48,14 +55,21 @@ function loadData(channel) { |
|
|
gender: channel
|
|
|
},
|
|
|
success: function(data) {
|
|
|
$('.brand-content').html(data);
|
|
|
$brandContent.html(data);
|
|
|
|
|
|
initialize();
|
|
|
|
|
|
$('html,body').animate({
|
|
|
scrollTop: 0
|
|
|
}, 100, function() {
|
|
|
$tabBox.removeClass('fastening');
|
|
|
$contentIndex.removeClass('distance');
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('.brand-cha').find('li').click(function() {
|
|
|
$brandCha.find('li').click(function() {
|
|
|
gender = $(this).find('span').text().replace(/[^A-Za-z]+/g, '').toLowerCase();
|
|
|
|
|
|
$(this).addClass('focus').siblings().removeClass('focus');
|
...
|
...
|
@@ -79,15 +93,30 @@ $('.brand-tab').find('li').click(function() { |
|
|
$(this).addClass('active').siblings().removeClass('active');
|
|
|
|
|
|
if ($(this).hasClass('brand')) {
|
|
|
$('.brand-content').removeClass('hide').siblings().addClass('hide');
|
|
|
$('.channel-tab').removeClass('hide');
|
|
|
$('.brand-cha').removeClass('hide').siblings().addClass('hide');
|
|
|
$brandContent.removeClass('hide').siblings().addClass('hide');
|
|
|
$channelTab.removeClass('hide');
|
|
|
$brandCha.removeClass('hide').siblings().addClass('hide');
|
|
|
} else {
|
|
|
$('.category-content').removeClass('hide').siblings().addClass('hide');
|
|
|
$categoryContent.removeClass('hide').siblings().addClass('hide');
|
|
|
$('.channel-tab').addClass('hide');
|
|
|
}
|
|
|
|
|
|
initialize();
|
|
|
|
|
|
// 页面切换回到头部
|
|
|
$('html,body').animate({
|
|
|
scrollTop: 0
|
|
|
}, 100, function() {
|
|
|
if (!$brandContent.hasClass('hide')) {
|
|
|
$tabBox.removeClass('fastening');
|
|
|
$contentIndex.removeClass('distance');
|
|
|
} else {
|
|
|
$tabBox.removeClass('fastening');
|
|
|
$categoryNav.removeClass('loca');
|
|
|
$('.blk-cate-all .content').removeClass('living');
|
|
|
$contentIndex.removeClass('distance');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if ($listBox.find('li').length <= 0) {
|
...
|
...
|
@@ -97,24 +126,24 @@ if ($listBox.find('li').length <= 0) { |
|
|
$(window).scroll(function() {
|
|
|
var totalHeight = $('#yoho-header').height() + $('.tab-box').height();
|
|
|
|
|
|
if (!$('.brand-content').hasClass('hide')) {
|
|
|
if (!$brandContent.hasClass('hide')) {
|
|
|
if ($(this).scrollTop() >= $('#yoho-header').height()) {
|
|
|
$('.tab-box').addClass('fastening');
|
|
|
$('.content-index').addClass('distance');
|
|
|
$tabBox.addClass('fastening');
|
|
|
$contentIndex.addClass('distance');
|
|
|
$('.list-box').css('top', $('.tab-box').height());
|
|
|
} else {
|
|
|
$('.tab-box').removeClass('fastening');
|
|
|
$('.content-index').removeClass('distance');
|
|
|
$tabBox.removeClass('fastening');
|
|
|
$contentIndex.removeClass('distance');
|
|
|
$('.list-box').css('top', totalHeight - $(this).scrollTop());
|
|
|
}
|
|
|
} else {
|
|
|
if ($(this).scrollTop() >= $('#yoho-header').height()) {
|
|
|
$('.tab-box').addClass('fastening');
|
|
|
$('.category-nav').addClass('loca');
|
|
|
$tabBox.addClass('fastening');
|
|
|
$categoryNav.addClass('loca');
|
|
|
$('.blk-cate-all .content').addClass('living');
|
|
|
} else {
|
|
|
$('.tab-box').removeClass('fastening');
|
|
|
$('.category-nav').removeClass('loca');
|
|
|
$tabBox.removeClass('fastening');
|
|
|
$categoryNav.removeClass('loca');
|
|
|
$('.blk-cate-all .content').removeClass('living');
|
|
|
}
|
|
|
}
|
...
|
...
|
|