document.addEventListener("DOMContentLoaded", () => { // Sentinel element at top const sentinel = document.createElement("div"); sentinel.style.cssText = "position:absolute;top:0;left:0;height:1px;width:1px;pointer-events:none;"; document.body.prepend(sentinel); // Toggle scrolled class on body const observer = new IntersectionObserver(([entry]) => { const atTop = entry.isIntersecting; document.body.classList.toggle("header-scrolled", !atTop); document.body.classList.toggle("header-at-top", atTop); // Always show header when at top if (atTop) { document.body.classList.remove("header-hidden"); document.body.classList.add("header-visible"); } }, { threshold: 0 }); observer.observe(sentinel); // ======================= // HIDE / SHOW ON SCROLL LOGIC // ======================= let lastScrollY = window.scrollY; let ticking = false; const SCROLL_THRESHOLD = 10; // Minimum scroll distance to trigger hide/show function updateHeaderVisibility() { const currentScrollY = window.scrollY; const scrollDifference = currentScrollY - lastScrollY; // If at the very top, always show if (currentScrollY SCROLL_THRESHOLD) { if (scrollDifference > 0) { // Scrolling DOWN - hide header document.body.classList.add("header-hidden"); document.body.classList.remove("header-visible"); } else { // Scrolling UP - show header document.body.classList.remove("header-hidden"); document.body.classList.add("header-visible"); } lastScrollY = currentScrollY; } ticking = false; } // Listen to scroll events window.addEventListener("scroll", () => { if (!ticking) { window.requestAnimationFrame(updateHeaderVisibility); ticking = true; } }, { passive: true }); // Initialize as visible document.body.classList.add("header-visible"); // ======================= // FIX HEADER WRAPPER HEIGHT // ======================= const headerWrap = document.querySelector(".elementor.elementor-location-header"); const desktopEl = document.querySelector("#desktopHeader"); const mobileEl = document.querySelector("#mobileHeader"); if (!headerWrap) return; const setWrapHeight = () => { const isDesktop = window.innerWidth > 1200; // adjust to your Elementor breakpoint const h = isDesktop ? (desktopEl?.offsetHeight || 0) : (mobileEl?.offsetHeight || 0); headerWrap.style.height = h + "px"; }; setWrapHeight(); window.addEventListener("resize", setWrapHeight, { passive: true }); // Auto-update if header height changes (menus, fonts, responsive shifts) if ("ResizeObserver" in window) { const ro = new ResizeObserver(setWrapHeight); if (desktopEl) ro.observe(desktopEl); if (mobileEl) ro.observe(mobileEl); } });
(function() { var bb_initialized = false; document.addEventListener('click', function(e) { if (!e.target.closest('.bb-trigger')) return; e.preventDefault(); e.stopPropagation(); if (bb_initialized && window.BB && window.BB.api) { BB.api.openModal('leadWorkflow'); return; } function init() { if (window.BB) { BB.init('1254053809', document.getElementById('bb-abec1'), {type:'api'}); bb_initialized = true; setTimeout(function() { if (window.BB.api) BB.api.openModal('leadWorkflow'); }, 500); } } if (window.BB) { init(); } else { var s = document.createElement('script'); s.src = 'https://cdn.bankingbridge.com/assets/external/index.js'; s.async = true; s.onload = init; document.head.appendChild(s); } }, true); })();
for the ambitious and thoughtful school leader

resources

Grow your capacity and capability. Guides, tools, and learning resources for navigating change, strengthening your leadership, or considering what comes next.