Apply sticky removal to the correct ToC element

This commit is contained in:
Helen Chong 2024-04-16 00:43:45 +08:00
parent dbe2f4896a
commit 1230880e84
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@
// Remove the stickiness of the sidebar ToC if it is larger than screen height // Remove the stickiness of the sidebar ToC if it is larger than screen height
function preventSidebarOverflow() { function preventSidebarOverflow() {
if (document.documentElement.clientHeight < tocEl.offsetHeight + 50) { if (document.documentElement.clientHeight < tocEl.offsetHeight + 50) {
tocEl.style.marginTop = "0"; tocWrapper.style.marginTop = "0";
tocEl.style.position = "static"; tocWrapper.style.position = "static";
} }
} }
preventSidebarOverflow(); preventSidebarOverflow();