docs-site: fix intersection observer

This commit is contained in:
Glen Huang
2025-10-16 21:25:57 +08:00
parent b899f95cf6
commit 271b6fe7fc

View File

@@ -32,7 +32,7 @@
observer?.disconnect();
observer = new IntersectionObserver(onIntersectionChange, {
threshold: 1,
rootMargin: `${-tocEl.offsetHeight}px 0 0`,
rootMargin: `${-tocEl.offsetHeight}px 0px 0px`,
});
const els = contentEl.querySelectorAll("h1,h2,h3,h4,h5,h6");
for (const el of els) {