diff --git a/src/js/core/_core.js b/src/js/core/_core.js index 8a9d545..0b5c8e7 100644 --- a/src/js/core/_core.js +++ b/src/js/core/_core.js @@ -185,8 +185,7 @@ module.exports = { document.querySelectorAll("article").forEach((a) => { if ( a.getAttribute("data-template") != "none" ) { - // why are threshold: 0, rootMargin: 50vh throwing an error? - const observer = new IntersectionObserver((articles, { }) => { + const observer = new IntersectionObserver(articles => { articles.forEach(article => { let a = article.target; @@ -278,7 +277,7 @@ module.exports = { } }) - }) + }, { threshold: 0, rootMargin: (document.body.clientHeight / 2) + "px" }) observer.observe(a);