|
@@ -4,9 +4,7 @@ var $ = require('yoho-jquery'), |
|
@@ -4,9 +4,7 @@ var $ = require('yoho-jquery'), |
4
|
var categoryHeight = $('.tab-box').height(),
|
4
|
var categoryHeight = $('.tab-box').height(),
|
5
|
gender;
|
5
|
gender;
|
6
|
|
6
|
|
7
|
-var $intercept = $('.no-intercept'),
|
|
|
8
|
- $list = $('.brand-list-box'),
|
|
|
9
|
- $listBox = $('.list-box'),
|
7
|
+var $listBox = $('.list-box'),
|
10
|
$brandContent = $('.brand-content'),
|
8
|
$brandContent = $('.brand-content'),
|
11
|
$tabBox = $('.tab-box'),
|
9
|
$tabBox = $('.tab-box'),
|
12
|
$contentIndex = $('.content-index'),
|
10
|
$contentIndex = $('.content-index'),
|
|
@@ -28,6 +26,19 @@ function channels(key) { |
|
@@ -28,6 +26,19 @@ function channels(key) { |
28
|
return channel[key];
|
26
|
return channel[key];
|
29
|
}
|
27
|
}
|
30
|
|
28
|
|
|
|
29
|
+// 点击字母,页面滚动到相关区域
|
|
|
30
|
+function reference() {
|
|
|
31
|
+ $('.no-intercept').click(function() {
|
|
|
32
|
+ var name = $(this).attr('href').split('#')[1] === '0_9' ? '0~9' : $(this).attr('href').split('#')[1],
|
|
|
33
|
+ targetTop = $('.brand-list-box').find('[name="' + name + '"]').offset().top - categoryHeight;
|
|
|
34
|
+
|
|
|
35
|
+ $('html,body').animate({
|
|
|
36
|
+ scrollTop: targetTop
|
|
|
37
|
+ }, 200);
|
|
|
38
|
+ return false;
|
|
|
39
|
+ });
|
|
|
40
|
+}
|
|
|
41
|
+
|
31
|
function initialize() {
|
42
|
function initialize() {
|
32
|
$('.banner-swiper').each(function() {
|
43
|
$('.banner-swiper').each(function() {
|
33
|
if (!$(this).parents('.content').hasClass('hide') && $(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
|
44
|
if (!$(this).parents('.content').hasClass('hide') && $(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
|
|
@@ -65,6 +76,8 @@ function loadData(channel) { |
|
@@ -65,6 +76,8 @@ function loadData(channel) { |
65
|
$tabBox.removeClass('fastening');
|
76
|
$tabBox.removeClass('fastening');
|
66
|
$contentIndex.removeClass('distance');
|
77
|
$contentIndex.removeClass('distance');
|
67
|
});
|
78
|
});
|
|
|
79
|
+
|
|
|
80
|
+ reference();
|
68
|
}
|
81
|
}
|
69
|
});
|
82
|
});
|
70
|
}
|
83
|
}
|
|
@@ -77,16 +90,7 @@ $brandCha.find('li').click(function() { |
|
@@ -77,16 +90,7 @@ $brandCha.find('li').click(function() { |
77
|
loadData(channels(gender));
|
90
|
loadData(channels(gender));
|
78
|
});
|
91
|
});
|
79
|
|
92
|
|
80
|
-// 点击字母,页面滚动到相关区域
|
|
|
81
|
-$intercept.click(function() {
|
|
|
82
|
- var name = $(this).attr('href').split('#')[1] === '0_9' ? '0~9' : $(this).attr('href').split('#')[1],
|
|
|
83
|
- targetTop = $list.find('[name="' + name + '"]').offset().top - categoryHeight;
|
|
|
84
|
-
|
|
|
85
|
- $('html,body').animate({
|
|
|
86
|
- scrollTop: targetTop
|
|
|
87
|
- }, 200);
|
|
|
88
|
- return false;
|
|
|
89
|
-});
|
93
|
+reference();
|
90
|
|
94
|
|
91
|
$('.brand-tab').find('li').click(function() {
|
95
|
$('.brand-tab').find('li').click(function() {
|
92
|
|
96
|
|