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
ccbikai
9 years ago
Commit
13bcbb43e48b25bbd2e404411f8919d77afd75d5
1 parent
19a6792e
频道选择顶部搜索
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
53 deletions
static/js/index/channel.js
static/js/index/footer.js
template/m.yohobuy.com/partials/layout/use.phtml
static/js/index/channel.js
0 → 100644
View file @
13bcbb4
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
var
$
=
require
(
'jquery'
);
var
$searchBox
=
$
(
'.search-box'
),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
$searchBox
.
find
(
'input'
).
on
(
'focus'
,
function
()
{
$indexLogo
.
css
({
width
:
0
,
display
:
'none'
});
$searchBox
.
css
({
width
:
'12.8rem'
});
$indexSearch
.
css
({
width
:
'15.5rem'
});
$
(
'.clear-text, .no-search'
).
show
();
}).
on
(
'blur'
,
function
()
{
$indexLogo
.
css
({
width
:
'5.4rem'
,
display
:
'block'
});
$searchBox
.
css
({
width
:
'8.8rem'
});
$indexSearch
.
css
({
width
:
'9.6rem'
});
$
(
'.clear-text, .no-search'
).
hide
();
});
$searchBox
.
find
(
'.clear-text'
).
click
(
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
).
trigger
(
'focus'
);
});
// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);
// clearTextHammer.on('tap', function(e) {
// $searchBox.find('input').val('').trigger('focus');
// });
$searchBox
.
find
(
'.search-icon'
).
click
(
function
()
{
$indexSearch
.
submit
();
});
// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
// searchIconHammer.on('tap', function(e) {
// $indexSearch.submit();
// });
\ No newline at end of file
...
...
static/js/index/footer.js
View file @
13bcbb4
...
...
@@ -7,10 +7,6 @@
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'hammer'
);
var
$searchBox
=
$
(
'.search-box'
),
$indexSearch
=
$
(
'.index-search'
),
$indexLogo
=
$
(
'.index-logo'
);
var
floatLayerCloseHammer
,
floatLayerBtnHammer
;
function
downLoadApp
()
{
...
...
@@ -66,52 +62,3 @@ if (!window.cookie('_float-layer-app')) {
$
(
'#float-layer-app'
).
hide
();
}
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
$searchBox
.
find
(
'input'
).
on
(
'focus'
,
function
()
{
$indexLogo
.
css
({
width
:
0
,
display
:
'none'
});
$searchBox
.
css
({
width
:
'12.8rem'
});
$indexSearch
.
css
({
width
:
'15.5rem'
});
$
(
'.clear-text, .no-search'
).
show
();
}).
on
(
'blur'
,
function
()
{
$indexLogo
.
css
({
width
:
'5.4rem'
,
display
:
'block'
});
$searchBox
.
css
({
width
:
'8.8rem'
});
$indexSearch
.
css
({
width
:
'9.6rem'
});
$
(
'.clear-text, .no-search'
).
hide
();
});
$searchBox
.
find
(
'.clear-text'
).
click
(
function
()
{
$searchBox
.
find
(
'input'
).
val
(
''
).
trigger
(
'focus'
);
});
// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);
// clearTextHammer.on('tap', function(e) {
// $searchBox.find('input').val('').trigger('focus');
// });
$searchBox
.
find
(
'.search-icon'
).
click
(
function
()
{
$indexSearch
.
submit
();
});
// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
// searchIconHammer.on('tap', function(e) {
// $indexSearch.submit();
// });
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
13bcbb4
...
...
@@ -89,6 +89,7 @@
{{!-- 频道选择页 --}}
{{#if channelPage}}
<script>
seajs.use('js/index/channel');
seajs.use('js/index/footer');
</script>
{{/if}}
...
...
Please
register
or
login
to post a comment