Authored by ccbikai

品牌一优化

... ... @@ -18,6 +18,7 @@ var swiper,
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
minBrandListTop,
searchArray = [];
var brandsData,
... ... @@ -42,13 +43,15 @@ $('.yoho-header').css({
});
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
$fixTitleBar.hide();
$fixTitleBar.css({
position: 'fixed',
top: brandSwipe
}).hide();
minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
$('.brand-list').last().append($fixTitleBar);
$(window).scroll(function() {
var scrTop = $(window).scrollTop(),
minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() +
$('.banner-top').outerHeight();
var scrTop = $(window).scrollTop();
if ($brandList.eq(0).offset().top < minBrandListTop) {
$fixTitleBar.hide();
... ... @@ -59,9 +62,7 @@ $(window).scroll(function() {
if (scrTop >= offTop) {
$fixTitleBar.css({
display: 'block',
position: 'fixed',
top: brandSwipe
display: 'block'
}).find('h2').html($(this).find('.title-bar').text());
}
... ...
... ... @@ -55,11 +55,14 @@
right: -74rem / $pxConvertRem;
font-size: 32rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
color: #666;
color: #bdbdbd;
}
.cancel-btn {
display: inline;
color: #bdbdbd;
font-size: 32rem / $pxConvertRem;
vertical-align: middle;
}
.clear-text {
... ... @@ -86,9 +89,15 @@
.img-box {
display: table-cell;
vertical-align: middle;
width: 100%;
text-align: center;
width: 158rem / $pxConvertRem;
height: 158rem / $pxConvertRem;
}
img {
max-width: 140rem / $pxConvertRem;
max-height: 140rem / $pxConvertRem;
}
}
}
}
... ...