shkola/wp-content/themes/dekart/assets/js/pksh-sticky-cta.js
2026-10-08 16:59:02 +00:00

20 lines
427 B
JavaScript

/**
*
*
* @package Dekart
*/
(function () {
var sticky = document.querySelector('.sticky-cta-desktop');
var hero = document.querySelector('.ds-hero');
if (!sticky || !hero) return;
var observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
sticky.classList.toggle('visible', !entry.isIntersecting);
});
}, { threshold: 0 });
observer.observe(hero);
})();