fix toc menu

This commit is contained in:
anarsec 2024-04-14 14:26:54 +00:00
parent 40d727d8a3
commit 7daa9fe776
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View file

@ -29,12 +29,7 @@
const menuAbsTop = menuRect.top - bodyRect.top;
const elemAbsBottom = elemRect.bottom - bodyRect.top;
const h = (window.innerHeight || document.documentElement.clientHeight);
if(elemAbsBottom > menuAbsTop + h - 48 - bottomGap){
document.querySelector(".menu").style = "position: sticky; top: " + (menuAbsTop - elemAbsBottom + h - bottomGap).toString() + "px";
}
else{
document.querySelector(".menu").style = "position: sticky; top: 48px;";
}
document.querySelector(".menu").style = "position: sticky; top: 48px;";
}
function activateIfVisible() {