diff options
author | jeffreytse <jeffreytse.mail@gmail.com> | 2020-07-12 16:19:42 +0800 |
---|---|---|
committer | jeffreytse <jeffreytse.mail@gmail.com> | 2020-07-12 16:19:42 +0800 |
commit | 50a9106b6c72a97aee9d6c430c1b3dac81ee5d3e (patch) | |
tree | 0545f38052034f324348d5bc40d6446edc3c2fe4 /_includes | |
parent | b83c3ac2377deab05c7c80fb9c06718971e2bfb9 (diff) |
feat: change article menu style
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/sidebar/article-menu.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/_includes/sidebar/article-menu.html b/_includes/sidebar/article-menu.html index ff984b6..96a4968 100644 --- a/_includes/sidebar/article-menu.html +++ b/_includes/sidebar/article-menu.html @@ -7,7 +7,7 @@ </style> <div class="post-menu"> - <div class="post-menu-title">Contents</div> + <div class="post-menu-title">TOC</div> <div class="post-menu-content"></div> </div> @@ -49,7 +49,8 @@ var headerHeight = headerTop + headerHeight + 20; if (headingRect.top <= headerHeight) { var id = 'h-' + h.getAttribute('id'); - var curActive = menuContent.querySelector('a[href="#' + id + '"]'); + var a = menuContent.querySelector('a[href="#' + id + '"]'); + var curActive = a.parentNode; if (curActive) { curActive.classList.add('active'); } |