Hexo: 导航菜单

This commit is contained in:
tangly1024
2022-03-31 17:55:08 +08:00
parent 0ff13b7158
commit 3afbe0f8ee
3 changed files with 5 additions and 9 deletions

View File

@@ -37,7 +37,8 @@ export default function HeaderArticle ({ post, siteInfo }) {
const updateTopNav = () => {
if (!isDarkMode) {
const stickyNavElement = document.getElementById('sticky-nav')
if (window.scrollY < window.innerHeight) {
const header = document.querySelector('#header')
if (window.scrollY < header.clientHeight) {
stickyNavElement?.classList?.add('dark')
} else {
stickyNavElement?.classList?.remove('dark')