...
|
...
|
@@ -52,11 +52,60 @@ if ($brandList.length > 0) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]);
|
|
|
myHammer.on('tap', function(e) {
|
|
|
var index = $(this).index();
|
|
|
if ($('#right-bar .con').find('b').unbind()[0]) {
|
|
|
myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]);
|
|
|
myHammer.on('tap', function(e) {
|
|
|
var index = $(this).index();
|
|
|
|
|
|
if ($('.bar-' + index).size() > 0) {
|
|
|
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
|
|
|
}
|
|
|
if ($('.bar-' + index).size() > 0) {
|
|
|
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function searchResult(type) {
|
|
|
var keyword = $('#keyword').val(),
|
|
|
gender = $('#gender').val();
|
|
|
|
|
|
$.get('/brands/search', {
|
|
|
keyword: keyword,
|
|
|
gender: gender,
|
|
|
type: type
|
|
|
}, function(html) {
|
|
|
$('.search-result').html(html);
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$('#keyword').on('keyup', function() {
|
|
|
searchResult(0);
|
|
|
}).on('keydown', function() {
|
|
|
$(this).closest('.search-box').css('width', '11.25rem');
|
|
|
$('.search-action').show();
|
|
|
}).on('blur', function() {
|
|
|
$(this).closest('.search-box').css('width', '12.5rem');
|
|
|
$('.search-action').hide();
|
|
|
});
|
|
|
|
|
|
$('#search-btn').on('tap', function() {
|
|
|
searchResult(1);
|
|
|
});
|
|
|
|
|
|
$('.clear-text').on('tap', function() {
|
|
|
$('#keyword').val('').trigger('input');
|
|
|
});
|
|
|
|
|
|
$('form.search-box').on('submit', function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
$('.clear-history').on('tap', function() {
|
|
|
|
|
|
// setcookie('h_brands', '', {
|
|
|
// expire: -1,
|
|
|
// path: '/',
|
|
|
// domain: '.m.yohobuy.com'
|
|
|
// });
|
|
|
$('#history-keyword').remove();
|
|
|
$(this).hide();
|
|
|
}); |
...
|
...
|
|