mirror of
https://github.com/tchartron/blow
synced 2024-11-27 14:50:56 +00:00
update
This commit is contained in:
parent
d1463d3fc9
commit
c644b56495
1 changed files with 7 additions and 1 deletions
|
@ -18,7 +18,13 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
// console.log(entry.intersectionRatio)
|
||||
console.log('entry', entry)
|
||||
console.log('current', current_intersectiong_entry)
|
||||
if (entry.isIntersecting) {
|
||||
if (current_intersectiong_entry !== null && current_intersectiong_entry.isIntersecting === false) {
|
||||
//Previous entry not intersecting anymore remove class and find the new one
|
||||
let res = findCorrespondingTocTitle(current_intersectiong_entry.target)
|
||||
current_selected_toc.parentElement.classList.remove('bg-blue-800');
|
||||
current_intersectiong_entry = null
|
||||
}
|
||||
if (entry.isIntersecting && current_intersectiong_entry === null) {
|
||||
console.log('processing')
|
||||
if (current_intersectiong_entry !== null && current_intersectiong_entry.target.getBoundingClientRect().y > 0) {
|
||||
console.log('stop')
|
||||
|
|
Loading…
Reference in a new issue