intersection observer wont scroll
Created a page for a friend using intersection observer js where the divs/images should appear as you scroll down except something is stopping it from scrolling further than the visible page-
https://andylilien.com/generalreel/
but works on mine with the same script and relevant css
https://toddheymandirector.com/reel/
Ive tried overflow:scroll etc nothing has worked
the js
<script>
if ( 'IntersectionObserver' in window ) {
let observer = new IntersectionObserver(function (entries, observer) {
let delay = 0;
entries.forEach(function (entry) {
if (entry.isIntersecting) {
setTimeout(function () {
entry.target.classList.add('fadeInVideo');
}, delay);
delay += 200;
observer.unobserve(entry.target);
}
});
}, { threshold: 0.15 } ); // only show elemenst when 15% inside bottom of viewport
// observe the elements to be animated
document.querySelectorAll( '.reelVideoContainer' ).forEach( function (el) {
observer.observe(el);
} );
}
</script>
thoughts?
