|
@@ -4,15 +4,13 @@ |
|
@@ -4,15 +4,13 @@ |
4
|
* @date: 2015/10/28
|
4
|
* @date: 2015/10/28
|
5
|
*/
|
5
|
*/
|
6
|
var $ = require('jquery');
|
6
|
var $ = require('jquery');
|
7
|
-
|
|
|
8
|
var $searchBox = $('.search-box'),
|
7
|
var $searchBox = $('.search-box'),
|
9
|
$indexSearch = $('.index-search'),
|
8
|
$indexSearch = $('.index-search'),
|
10
|
$indexLogo = $('.index-logo');
|
9
|
$indexLogo = $('.index-logo');
|
11
|
|
10
|
|
12
|
-$searchBox.find('input').on('focus', function () {
|
11
|
+$searchBox.find('input').on('focus', function() {
|
13
|
$indexLogo.css({
|
12
|
$indexLogo.css({
|
14
|
- width: 0,
|
|
|
15
|
- display: 'none'
|
13
|
+ width: 0
|
16
|
});
|
14
|
});
|
17
|
$searchBox.css({
|
15
|
$searchBox.css({
|
18
|
width: '12.8rem'
|
16
|
width: '12.8rem'
|
|
@@ -21,10 +19,9 @@ $searchBox.find('input').on('focus', function () { |
|
@@ -21,10 +19,9 @@ $searchBox.find('input').on('focus', function () { |
21
|
width: '15.5rem'
|
19
|
width: '15.5rem'
|
22
|
});
|
20
|
});
|
23
|
$('.clear-text, .no-search').show();
|
21
|
$('.clear-text, .no-search').show();
|
24
|
-}).on('blur', function () {
|
22
|
+}).on('blur', function() {
|
25
|
$indexLogo.css({
|
23
|
$indexLogo.css({
|
26
|
- width: '5.4rem',
|
|
|
27
|
- display: 'block'
|
24
|
+ width: '5.4rem'
|
28
|
});
|
25
|
});
|
29
|
$searchBox.css({
|
26
|
$searchBox.css({
|
30
|
width: '8.8rem'
|
27
|
width: '8.8rem'
|
|
@@ -34,11 +31,10 @@ $searchBox.find('input').on('focus', function () { |
|
@@ -34,11 +31,10 @@ $searchBox.find('input').on('focus', function () { |
34
|
});
|
31
|
});
|
35
|
$('.clear-text, .no-search').hide();
|
32
|
$('.clear-text, .no-search').hide();
|
36
|
});
|
33
|
});
|
37
|
-
|
|
|
38
|
-$searchBox.find('.clear-text').click(function () {
|
34
|
+$searchBox.find('.clear-text').click(function() {
|
39
|
$searchBox.find('input').val('').trigger('focus');
|
35
|
$searchBox.find('input').val('').trigger('focus');
|
40
|
});
|
36
|
});
|
41
|
-
|
|
|
42
|
-$searchBox.find('.search-icon').click(function () {
|
37
|
+$searchBox.find('.search-icon').click(function() {
|
43
|
$indexSearch.submit();
|
38
|
$indexSearch.submit();
|
44
|
-}); |
|
|
|
|
39
|
+});
|
|
|
40
|
+ |