Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
f2fa2f0554a9d5e5c98bcbea345929015452c62b
1 parent
586059bb
light search
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
static/js/index/channel.js
static/sass/index/_index.scss
template/m.yohobuy.com/actions/index/index/index.phtml
static/js/index/channel.js
View file @
f2fa2f0
...
...
@@ -9,14 +9,21 @@ var $searchBox = $('.search-box'),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
var
$search
=
$searchBox
.
children
(
'input'
),
$cancelSearch
=
$indexSearch
.
children
(
'.no-search'
);
var
$search
=
$searchBox
.
children
(
'input[type="text"]'
),
$cancelSearch
=
$indexSearch
.
children
(
'.no-search'
),
$searchIcon
=
$searchBox
.
children
(
'.search-icon'
);
require
(
'../common'
);
$search
.
on
(
'focus'
,
function
()
{
$indexSearch
.
addClass
(
'action'
);
$indexLogo
.
addClass
(
'action'
);
}).
on
(
'input'
,
function
()
{
if
(
$search
.
val
()
===
''
)
{
$searchIcon
.
addClass
(
'empty'
);
}
else
{
$searchIcon
.
removeClass
(
'empty'
);
}
});
$cancelSearch
.
on
(
'touchstart'
,
function
()
{
...
...
static/sass/index/_index.scss
View file @
f2fa2f0
...
...
@@ -81,7 +81,11 @@
}
.search-icon
{
right
:
10rem
/
$pxConvertRem
;
color
:
#e6e6e6
;
color
:
#000
;
&
.empty
{
color
:
#e6e6e6
;
}
}
}
...
...
template/m.yohobuy.com/actions/index/index/index.phtml
View file @
f2fa2f0
...
...
@@ -9,7 +9,7 @@
<input
type=
"hidden"
name=
"from"
value=
"search"
>
<input
type=
"text"
name=
"query"
placeholder=
"搜索"
autocomplete=
"off"
>
<span
class=
"iconfont clear-text"
>
623
;</span>
<span
class=
"iconfont search-icon"
>
60
f;</span>
<span
class=
"iconfont search-icon
empty
"
>
60
f;</span>
</div>
</form>
</div>
...
...
Please
register
or
login
to post a comment