channel.js
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
var $ = require('jquery');
var $searchBox = $('.search-box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
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();
});
$searchBox.find('.clear-text').on('touchend', function() {
$searchBox.find('input').val('');
});
$searchBox.find('.search-icon').on('touchend', function() {
$indexSearch.submit();
});
$('.no-search').on('touchend', function() {
$searchBox.find('input').val('');
hideBigSearch();
});
window.rePosFooter && window.rePosFooter();