Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SWLab UI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hyeryung
SWLab UI
Commits
e0b0fad1
Commit
e0b0fad1
authored
7 months ago
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test scrollItemToMidpoint fn -- scrollTop
parent
b9516866
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
nav.css
src/css/nav.css
+0
-4
01-nav.js
src/js/01-nav.js
+2
-2
No files found.
src/css/nav.css
View file @
e0b0fad1
...
...
@@ -227,10 +227,6 @@
transform
:
rotate
(
90deg
);
}
.nav-item.is-current-page
>
.nav-menu-toggle
{
background-image
:
url(../img/caret_white.svg)
;
}
.is-current-page
>
.nav-link
,
.is-current-page
>
.nav-text
{
font-weight
:
var
(
--body-font-weight-bold
);
...
...
This diff is collapsed.
Click to expand it.
src/js/01-nav.js
View file @
e0b0fad1
...
...
@@ -159,8 +159,8 @@
function
scrollItemToMidpoint
(
panel
,
el
)
{
var
rect
=
panel
.
getBoundingClientRect
()
var
effectiveHeight
=
rect
.
height
var
navStyle
=
window
.
getComputedStyle
(
nav
)
if
(
navStyle
.
position
===
'sticky'
)
effectiveHeight
-=
rect
.
top
-
parseFloat
(
navStyle
.
top
)
//
var navStyle = window.getComputedStyle(nav)
//
if (navStyle.position === 'sticky') effectiveHeight -= rect.top - parseFloat(navStyle.top)
panel
.
scrollTop
=
Math
.
max
(
0
,
(
el
.
getBoundingClientRect
().
height
-
effectiveHeight
)
*
0.5
+
el
.
offsetTop
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment