$$plugins.define('intersecting', function (element, options) { const el = document.querySelector(options.target); const observer = new window.IntersectionObserver(([entry]) => { const intersectionRatio = entry.intersectionRatio.toFixed(2); if (entry.isIntersecting) { element.classList.add("sticky"); } else { element.classList.remove("sticky"); } }, { root: null, rootMargin: '-30% 0px -70%', threshold: 0 }) observer.observe(el) });