template.js 440 B

1234567891011121314151617
  1. (function(){
  2. window.addEventListener('load', () => {
  3. const el = document.querySelector('.phpdocumentor-on-this-page__content')
  4. if (!el) {
  5. return;
  6. }
  7. const observer = new IntersectionObserver(
  8. ([e]) => {
  9. e.target.classList.toggle("-stuck", e.intersectionRatio < 1);
  10. },
  11. {threshold: [1]}
  12. );
  13. observer.observe(el);
  14. })
  15. })();