idk
This commit is contained in:
1 parent
e68d357177
commit
3e3382df57
65 files changed
+1836
-42
No files matched your search
@@ -53,6 +53,11 @@ else
|
||||
<!-- Smooth scroll + scroll-spy for one-page layout -->
|
||||
<script>
|
||||
(function() {
|
||||
// This partial is printed by _open.php BEFORE the page sections (#equipa, …)
|
||||
// exist in the DOM, so binding must wait for DOMContentLoaded — otherwise
|
||||
// querySelector('#equipa') returns null, `sections` stays empty, and neither
|
||||
// the smooth-scroll nor the scroll-spy (active nav link) ever bind.
|
||||
function init() {
|
||||
/* ── Eased smooth-scroll helper ──────────────────────────────────────── */
|
||||
function smoothScrollTo(targetEl, duration) {
|
||||
var start = window.scrollY;
|
||||
@@ -149,7 +154,15 @@ else
|
||||
// CrossFit page the list is empty and the PHP-set active pill must stay.
|
||||
if (sections.length > 0) {
|
||||
window.addEventListener('scroll', updateActive, { passive: true });
|
||||
window.addEventListener('resize', updateActive, { passive: true });
|
||||
updateActive();
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
Reference in new issue
Block a user