|
@@ -18,6 +18,7 @@ var swiper, |
|
@@ -18,6 +18,7 @@ var swiper, |
18
|
var searchH = $('.newbrand-search').outerHeight(),
|
18
|
var searchH = $('.newbrand-search').outerHeight(),
|
19
|
headerH = $('.yoho-header').outerHeight(),
|
19
|
headerH = $('.yoho-header').outerHeight(),
|
20
|
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
|
20
|
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
|
|
|
21
|
+ minBrandListTop,
|
21
|
searchArray = [];
|
22
|
searchArray = [];
|
22
|
|
23
|
|
23
|
var brandsData,
|
24
|
var brandsData,
|
|
@@ -42,13 +43,15 @@ $('.yoho-header').css({ |
|
@@ -42,13 +43,15 @@ $('.yoho-header').css({ |
42
|
});
|
43
|
});
|
43
|
|
44
|
|
44
|
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
|
45
|
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
|
45
|
-$fixTitleBar.hide();
|
46
|
+$fixTitleBar.css({
|
|
|
47
|
+ position: 'fixed',
|
|
|
48
|
+ top: brandSwipe
|
|
|
49
|
+}).hide();
|
|
|
50
|
+minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
|
46
|
$('.brand-list').last().append($fixTitleBar);
|
51
|
$('.brand-list').last().append($fixTitleBar);
|
47
|
|
52
|
|
48
|
$(window).scroll(function() {
|
53
|
$(window).scroll(function() {
|
49
|
- var scrTop = $(window).scrollTop(),
|
|
|
50
|
- minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() +
|
|
|
51
|
- $('.banner-top').outerHeight();
|
54
|
+ var scrTop = $(window).scrollTop();
|
52
|
|
55
|
|
53
|
if ($brandList.eq(0).offset().top < minBrandListTop) {
|
56
|
if ($brandList.eq(0).offset().top < minBrandListTop) {
|
54
|
$fixTitleBar.hide();
|
57
|
$fixTitleBar.hide();
|
|
@@ -59,9 +62,7 @@ $(window).scroll(function() { |
|
@@ -59,9 +62,7 @@ $(window).scroll(function() { |
59
|
|
62
|
|
60
|
if (scrTop >= offTop) {
|
63
|
if (scrTop >= offTop) {
|
61
|
$fixTitleBar.css({
|
64
|
$fixTitleBar.css({
|
62
|
- display: 'block',
|
|
|
63
|
- position: 'fixed',
|
|
|
64
|
- top: brandSwipe
|
65
|
+ display: 'block'
|
65
|
}).find('h2').html($(this).find('.title-bar').text());
|
66
|
}).find('h2').html($(this).find('.title-bar').text());
|
66
|
}
|
67
|
}
|
67
|
|
68
|
|