mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-08-03 03:46:35 -04:00
graphene update
This commit is contained in:
parent
af1bc7fc97
commit
49f323d16c
4 changed files with 54 additions and 35 deletions
|
@ -30,6 +30,14 @@
|
|||
const elemAbsBottom = elemRect.bottom - bodyRect.top;
|
||||
const h = (window.innerHeight || document.documentElement.clientHeight);
|
||||
document.querySelector(".menu").style = "position: sticky; top: 48px;";
|
||||
const minScroll = tocIndex.offsetTop - document.querySelector(".menu").clientHeight + tocIndex.offsetHeight + 50;
|
||||
const maxScroll = tocIndex.offsetTop - tocIndex.offsetHeight - 50;
|
||||
if(document.querySelector(".menu").scrollTop < minScroll){
|
||||
document.querySelector(".menu").scrollTop = minScroll;
|
||||
}
|
||||
else if(document.querySelector(".menu").scrollTop > maxScroll){
|
||||
document.querySelector(".menu").scrollTop = maxScroll;
|
||||
}
|
||||
}
|
||||
|
||||
function activateIfVisible() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue