psr-15/doc/js/template.js

18 lines
440 B
JavaScript
Raw Permalink Normal View History

2024-07-11 17:52:26 +02:00
(function(){
window.addEventListener('load', () => {
const el = document.querySelector('.phpdocumentor-on-this-page__content')
if (!el) {
return;
}
const observer = new IntersectionObserver(
([e]) => {
e.target.classList.toggle("-stuck", e.intersectionRatio < 1);
},
{threshold: [1]}
);
observer.observe(el);
})
})();