Tweak style

This commit is contained in:
qingwei.li 2017-01-11 18:41:40 +08:00
parent d971948f10
commit 458e262a26
2 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,7 @@ export function scrollActiveSidebar () {
li.classList.add('active')
active = li
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView()
!hoveredOverSidebar && !sticky.noSticky && active.scrollIntoView()
}
window.removeEventListener('scroll', highlight)
@ -125,10 +125,10 @@ export function sticky () {
return (function () {
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
document.body.classList.add('sticky')
sticky.isSticky = true
sticky.noSticky = false
} else {
document.body.classList.remove('sticky')
sticky.isSticky = false
sticky.noSticky = true
}
})()
}

View File

@ -96,6 +96,7 @@ nav {
display: inline-block;
ul {
border-radius: 2px;
background-color: rgba($color-bg, .6);
border: 1px solid $color-primary;
opacity: 0;
@ -160,6 +161,7 @@ nav {
/* main */
main {
display: block;
size: 100vw 100%;
position: relative;
}