Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
78cc688f67244bdb9b23b40fbab1ecafb1dbe874
1 parent
78389ffc
侧边栏 返回效果
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
static/js/home/home.js
static/sass/home/_index.scss
static/sass/home/_side-nav.scss
static/js/home/home.js
View file @
78cc688
...
...
@@ -31,7 +31,7 @@ lazyLoad($('img.lazy'));
$
(
'.nav-btn'
).
on
(
'tap'
,
function
(
event
)
{
if
(
!
$
(
this
).
hasClass
(
'menu-open'
))
{
$
(
'.mobile-wrap'
).
addClass
(
'menu-open'
);
$
(
'.overlay'
).
addClass
(
'show'
);
$
(
'.overlay'
).
show
().
css
(
'opacity'
,
0.3
);
$
(
'.side-nav'
).
addClass
(
'on'
);
//设置boy高宽,页面不能上下滑动
...
...
@@ -48,13 +48,16 @@ $('.nav-btn').on('tap', function (event) {
$
(
'.mobile-wrap'
).
on
(
'tap'
,
function
()
{
if
(
$
(
this
).
hasClass
(
'menu-open'
))
{
$
(
'.mobile-wrap'
).
removeClass
(
'menu-open'
);
$
(
'.overlay'
).
removeClass
(
'show'
);
$
(
'.overlay'
).
css
(
'opacity'
,
0
);
$
(
'.sub-nav'
).
removeClass
(
'show'
);
$
(
'.side-nav'
).
removeClass
(
'on'
);
$
(
'body'
).
css
({
height
:
'auto'
,
overflow
:
'auto'
});
setTimeout
(
function
()
{
$
(
'.overlay'
).
hide
();
},
300
);
}
});
...
...
static/sass/home/_index.scss
View file @
78cc688
...
...
@@ -10,12 +10,11 @@
position
:
relative
;
z-index
:
2
;
background
:
#f0f0f0
;
@include
transition
(
transform
.3s
);
@include
transition
(
transform
.3s
ease-out
);
}
.mobile-wrap.menu-open
{
@include
transform
(
translateX
(
540rem
/
$pxConvertRem
));
@include
transition
(
transform
.3s
);
}
...
...
@@ -27,10 +26,12 @@
right
:
0
;
bottom
:
0
;
background
:
#000
;
opacity
:
0
.3
;
opacity
:
0
;
z-index
:
99
;
@include
transition
(
opacity
1s
);
}
.overlay.show
{
display
:
block
;
opacity
:
0
.3
;
}
...
...
static/sass/home/_side-nav.scss
View file @
78cc688
.side-nav
{
display
:
none
;
//
display: none;
background
:
#fff
;
position
:
fixed
;
top
:
0
;
...
...
@@ -8,6 +8,8 @@
left
:
0
;
z-index
:
1
;
overflow
:
hidden
;
@include
transform
(
translateX
(
-540rem
/
$pxConvertRem
));
@include
transition
(
all
.3s
ease-out
);
ul
{
background
:
#f0f0f0
;
...
...
@@ -103,20 +105,22 @@
}
.side-nav.on
{
display
:
block
;
// display: block;
@include
transform
(
translateX
(
0rem
/
$pxConvertRem
));
}
.sub-nav
{
// display: none;
position
:
fixed
;
top
:
0
;
right
:
100rem
/
$pxConvertRem
;
left
:
0
;
bottom
:
0
;
width
:
100%
;
background
:
#fff
!
important
;
z-index
:
2
;
@include
transform
(
translateX
(
100%
));
// z-index: 2;
@include
transform
(
translateX
(
540rem
/
$pxConvertRem
));
@include
transition
(
transform
0
.3s
);
li
{
...
...
Please
register
or
login
to post a comment