mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-06-17 02:59:35 -04:00
fix toc menu
This commit is contained in:
parent
40d727d8a3
commit
7daa9fe776
2 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue