Fix navigation and table of contents highlighting issues (#169)

This commit is contained in:
Eduard Gert
2024-03-15 16:33:03 +01:00
committed by GitHub
parent a7d0a1bbc8
commit 6a97841307
3 changed files with 6 additions and 7 deletions

View File

@@ -103,7 +103,7 @@ function useTableOfContents(tableOfContents) {
if (tableOfContents.length === 0) return
let headings = getHeadings(tableOfContents)
function onScroll() {
let top = window.scrollY
let top = window.scrollY + 10;
let current = headings[0]?.id
for (let heading of headings) {
if (top >= heading?.top) {