Authored by yyq

头部频道前端选中调整

{{# headerData}}
<div id="yoho-header" class="yoho-header {{headType}}" data-type="{{headType}}">
<div id="yoho-header" class="yoho-header" data-type="{{headType}}">
<div class="tool-wrapper clearfix">
<div class="center-content">
<div class="yoho-group-map left">
... ... @@ -66,7 +66,7 @@
<div class="main-logo"><a href="//www.yohobuy.com/" class="main-link"></a></div>
<ul class="main-nav-list">
{{# navbars}}
<li class="{{type}}{{#if active}} cure{{/if}}" {{#if ico}} style="background: url({{image ico 54 32}}) no-repeat center center"{{/if}}>
<li class="{{type}}"{{#if ico}} style="background: url({{image ico 54 32}}) no-repeat center center"{{/if}}>
{{#if ico}}
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}} class="menu-ico"></a>
{{^}}
... ... @@ -80,7 +80,7 @@
</li>
{{/ navbars}}
</ul>
<div class="func-area">
<div class="func-area hide">
<ul class="search-suggest"></ul>
<div class="search-2016">
<form action="//search.yohobuy.com" method="get" id="search-form">
... ... @@ -109,7 +109,7 @@
<div class="nav-wrapper clearfix">
<div class="center-content">
{{# subNavGroup}}
<ul class="sub-nav-list {{subType}}{{#if active}} cure{{/if}}">
<ul class="sub-nav-list {{subType}}">
{{# subNav}}
<li {{#if thirdNav}}class="contain-third"{{/if}}>
<a href="{{link}}">{{name}}
... ...
... ... @@ -9,6 +9,9 @@ var $ = require('yoho-jquery');
var homePage = $('.home-page').data('page'),
brandUrl = $('.logo-brand').data('url');
// 给头部js获取当前频道
window.homePage = homePage;
require('../common');
require('../plugins/slider');
... ...
... ... @@ -487,20 +487,17 @@ function isSupportCss3Animation() {
function syncPageChannel() {
var $header = $('#yoho-header'),
$navs;
var channel = window.cookie('_Channel') || 'boys',
type;
var channel = window.homePage || window.cookie('_Channel') || 'boys',
qs = window.queryString();
// 过滤频道页
if ($('.home-page').length) {
return;
}
channel = qs.channel ? qs.channel : channel;
if ($header && $header.length) {
$navs = $header.find('.' + channel);
type = $header.data('type');
if (channel === type || !$navs.length) {
return;
if (!$navs.length) {
channel = 'boys';
$navs = $header.find('.' + channel);
}
// 更新频道菜单选中状态
... ... @@ -508,7 +505,7 @@ function syncPageChannel() {
$navs.addClass('cure');
// 更新频道颜色
$header.attr('class', 'yoho-header ' + channel);
$header.addClass(channel).find('.func-area').removeClass('hide');
// 更新三级菜单jq对象
$subNav = $('.sub-nav-list.cure .contain-third');
... ...
... ... @@ -598,7 +598,6 @@
.nav-wrapper {
height: 40px;
width: 100%;
background-color: #3a3a3a;
position: relative;
.sub-nav-list {
... ... @@ -726,6 +725,12 @@
}
}
.yoho-header.boys {
.nav-wrapper {
background-color: #3a3a3a;
}
}
.yoho-header.girls {
.search-2016 {
background-color: #ff88ae;
... ...