Authored by ccbikai

品牌一优化

@@ -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
@@ -55,11 +55,14 @@ @@ -55,11 +55,14 @@
55 right: -74rem / $pxConvertRem; 55 right: -74rem / $pxConvertRem;
56 font-size: 32rem / $pxConvertRem; 56 font-size: 32rem / $pxConvertRem;
57 line-height: 60rem / $pxConvertRem; 57 line-height: 60rem / $pxConvertRem;
58 - color: #666; 58 + color: #bdbdbd;
59 } 59 }
60 60
61 .cancel-btn { 61 .cancel-btn {
62 display: inline; 62 display: inline;
  63 + color: #bdbdbd;
  64 + font-size: 32rem / $pxConvertRem;
  65 + vertical-align: middle;
63 } 66 }
64 67
65 .clear-text { 68 .clear-text {
@@ -86,9 +89,15 @@ @@ -86,9 +89,15 @@
86 .img-box { 89 .img-box {
87 display: table-cell; 90 display: table-cell;
88 vertical-align: middle; 91 vertical-align: middle;
89 - width: 100%; 92 + text-align: center;
  93 + width: 158rem / $pxConvertRem;
90 height: 158rem / $pxConvertRem; 94 height: 158rem / $pxConvertRem;
91 } 95 }
  96 +
  97 + img {
  98 + max-width: 140rem / $pxConvertRem;
  99 + max-height: 140rem / $pxConvertRem;
  100 + }
92 } 101 }
93 } 102 }
94 } 103 }