Authored by 毕凯

整理代码

... ... @@ -14,6 +14,7 @@ var swiper,
$brandList = $('.brand-list'),
$icon = $('.search-icon'),
$genderItem = $('.genderNav li'),
$searchAction = $('.search-action'),
hotBrandsSwiper;
var searchH = $('.newbrand-search').outerHeight(),
... ... @@ -156,11 +157,11 @@ if ($('.brand-search-page').length) {
if ($keyword.val().length) {
$icon.css('color', '#000');
$(this).closest('.search-box').css('width', '11.25rem');
$('.search-action').show();
$searchAction.show();
} else {
$icon.css('color', '#b2b2b2');
$(this).closest('.search-box').css('width', '12.5rem');
$('.search-action').hide();
$searchAction.hide();
}
searchResult();
}).focus();
... ... @@ -168,13 +169,13 @@ if ($('.brand-search-page').length) {
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
$icon.css('color', '#000');
$keyword.closest('.search-box').css('width', '11.25rem');
$('.search-action').show();
$searchAction.show();
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
e.preventDefault();
$('.search-result').html('');
$('#keyword').val('').trigger('input');
e.preventDefault();
e.srcEvent.stopPropagation();
});
... ...