From 99073158c59cafab9c19133428e9577e92ce5bfa Mon Sep 17 00:00:00 2001 From: Leilukin Date: Tue, 16 Apr 2024 00:43:45 +0800 Subject: [PATCH] Apply sticky removal to the correct ToC element --- src/_includes/toc.njk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_includes/toc.njk b/src/_includes/toc.njk index 6db3bb2d..232b4249 100644 --- a/src/_includes/toc.njk +++ b/src/_includes/toc.njk @@ -63,8 +63,8 @@ // Remove the stickiness of the sidebar ToC if it is larger than screen height function preventSidebarOverflow() { if (document.documentElement.clientHeight < tocEl.offsetHeight + 50) { - tocEl.style.marginTop = "0"; - tocEl.style.position = "static"; + tocWrapper.style.marginTop = "0"; + tocWrapper.style.position = "static"; } } preventSidebarOverflow();