Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
f407561368004fcf23ba8855021c53baee03c9ba
1 parent
2029d0b9
侧边栏点击当前栏目不刷新
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
static/js/home/home.js
static/js/home/home.js
View file @
f407561
...
...
@@ -49,8 +49,7 @@ navHammer.on('tap', function(event) {
return
false
;
});
mobileWrapHammer
=
new
Hammer
(
$
(
'.mobile-wrap'
)[
0
]);
mobileWrapHammer
.
on
(
'tap'
,
function
(
e
)
{
function
hideSideBar
()
{
if
(
$mobileWrap
.
hasClass
(
'menu-open'
))
{
$mobileWrap
.
removeClass
(
'menu-open'
);
$overlay
.
css
(
'opacity'
,
0
);
...
...
@@ -63,9 +62,14 @@ mobileWrapHammer.on('tap', function(e) {
setTimeout
(
function
()
{
$
(
'.overlay'
).
hide
();
},
300
);
e
.
srcEvent
.
stopPropagation
();
return
false
;
}
}
mobileWrapHammer
=
new
Hammer
(
$
(
'.mobile-wrap'
)[
0
]);
mobileWrapHammer
.
on
(
'tap'
,
function
(
e
)
{
hideSideBar
();
e
.
srcEvent
.
stopPropagation
();
return
false
;
});
//点击一级导航,弹出二级导航
...
...
@@ -75,6 +79,10 @@ $sideNav.on('touchend', 'li', function (e) {
$
(
this
).
find
(
'.sub-nav'
).
addClass
(
'show'
);
}
e
.
stopPropagation
();
if
(
e
.
target
.
pathname
===
location
.
pathname
)
{
hideSideBar
();
return
false
;
}
});
//返回一级导航,收起二级导航
...
...
Please
register
or
login
to post a comment