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

@ -508,6 +508,10 @@ $footer-padding: 1.0rem 2.5rem
.navbar-end
flex-wrap: wrap!important
/* hide for 1023px instead of default 768px */
.is-hidden-mobile
display: none !important
html
scroll-behavior: smooth
@ -586,5 +590,5 @@ code
color: #AE3B8B
.icon-text
font-size: 18px
font-size: 16px

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() {