Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -8,7 +8,8 @@ var $ = require('yoho.zepto'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.zeptolazyload');
var swiper;
var swiper,
$brandList = $('.brand-list');
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
... ... @@ -22,4 +23,27 @@ $('.yoho-header').css({
'z-index': 2,
position: 'fixed'
});
$('.banner-top').css('padding-top', '90px');
\ No newline at end of file
$('.banner-top').css('padding-top', '90px');
if ($brandList.length > 0) {
$(window).scroll(function() {
var scrTop = $(window).scrollTop(),
searchH = $('.newbrand-search').height(),
headerH = $('.yoho-header').height(),
brandSwipe = parseInt(searchH) + parseInt(headerH);
$('.brand-list').each(function() {
var offTop = $(this).offset().top - brandSwipe;
if (scrTop >= offTop) {
$brandList.find('.title-bar').css('position', 'static');
$(this).find('.title-bar').css({
position: 'fixed',
top: brandSwipe
});
} else {
$(this).find('.title-bar').css('position', 'static');
}
});
});
}
... ...