fix highlight on scroll
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d12c5941ed
commit
608c3f7759
1 changed files with 10 additions and 4 deletions
|
@ -37,10 +37,16 @@ function isVisible(tocIndex) {
|
|||
: document.querySelectorAll("section.section").item(1);
|
||||
|
||||
const c = current.getBoundingClientRect();
|
||||
if (next) {
|
||||
const n = next.getBoundingClientRect();
|
||||
const h = (window.innerHeight || document.documentElement.clientHeight);
|
||||
|
||||
return (c.top <= h) && (n.top - menuBarHeight >= 0);
|
||||
} else {
|
||||
const h = (window.innerHeight || document.documentElement.clientHeight);
|
||||
|
||||
return (c.top <= h);
|
||||
}
|
||||
}
|
||||
|
||||
function activateIfVisible() {
|
||||
|
|
Loading…
Reference in a new issue