Authored by xuqi

trigger input search

... ... @@ -70,6 +70,8 @@ function searchResult() {
i = 0,
html = '';
if (keyword !== '') {
// 遍历首字母搜索
$.each(brandsData, function(k, v) {
if ($.isArray(v)) {
... ... @@ -107,6 +109,7 @@ function searchResult() {
html += brandHtml.join('');
});
}
// 插入 dom,绑定事件
$('.search-result').html(html);
... ... @@ -118,7 +121,6 @@ if ($('.brand-search-page').length) {
$keyword.on('input', function() {
if ($keyword.val().length) {
searchResult();
$icon.css('color', '#000');
$(this).closest('.search-box').css('width', '11.25rem');
$('.search-action').show();
... ... @@ -127,6 +129,7 @@ if ($('.brand-search-page').length) {
$(this).closest('.search-box').css('width', '12.5rem');
$('.search-action').hide();
}
searchResult();
}).focus();
clearTextHammer = new Hammer($('.clear-text')[0]);
... ...