...
|
...
|
@@ -9,49 +9,27 @@ var $searchBox = $('.search-box'), |
|
|
$indexSearch = $('.index-search'),
|
|
|
$indexLogo = $('.index-logo');
|
|
|
|
|
|
var $search = $searchBox.children('input'),
|
|
|
$cancelSearch = $indexSearch.children('.no-search');
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
function showBigSearch() {
|
|
|
$indexLogo.css({
|
|
|
opacity: 0
|
|
|
});
|
|
|
$searchBox.css({
|
|
|
width: '12.8rem'
|
|
|
});
|
|
|
$indexSearch.css({
|
|
|
width: '15.5rem'
|
|
|
});
|
|
|
$('.clear-text, .no-search').show();
|
|
|
}
|
|
|
|
|
|
function hideBigSearch() {
|
|
|
$indexLogo.css({
|
|
|
opacity: 1
|
|
|
});
|
|
|
$searchBox.css({
|
|
|
width: '8.8rem'
|
|
|
});
|
|
|
$indexSearch.css({
|
|
|
width: '9.6rem'
|
|
|
});
|
|
|
$('.clear-text, .no-search').hide();
|
|
|
}
|
|
|
|
|
|
$searchBox.find('input').on('focus', function() {
|
|
|
showBigSearch();
|
|
|
$search.on('focus', function() {
|
|
|
$indexSearch.addClass('action');
|
|
|
$indexLogo.addClass('action');
|
|
|
});
|
|
|
|
|
|
$searchBox.find('.clear-text').on('touchend', function() {
|
|
|
$searchBox.find('input').val('');
|
|
|
});
|
|
|
$searchBox.find('.search-icon').on('touchend', function() {
|
|
|
$indexSearch.submit();
|
|
|
$cancelSearch.on('touchstart', function() {
|
|
|
$indexSearch.removeClass('action');
|
|
|
$indexLogo.removeClass('action');
|
|
|
|
|
|
$search.blur();
|
|
|
});
|
|
|
|
|
|
$('.no-search').on('touchend', function() {
|
|
|
$searchBox.find('input').val('');
|
|
|
hideBigSearch();
|
|
|
$searchBox.children('.clear-text').on('touchstart', function() {
|
|
|
$search.val('').focus();
|
|
|
});
|
|
|
|
|
|
// 底部计算有误
|
|
|
// window.rePosFooter && window.rePosFooter(); |
|
|
$searchBox.children('.search-icon').on('touchstart', function() {
|
|
|
$indexSearch.submit();
|
|
|
}); |
...
|
...
|
|