bf phase v
This commit is contained in:
+6
-25
@@ -547,35 +547,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Show/hide back to top button
|
||||
if (currentScroll > 300) {
|
||||
backToTopBtn.style.display = 'flex';
|
||||
} else {
|
||||
backToTopBtn.style.display = 'none';
|
||||
}
|
||||
|
||||
// Add/remove at-bottom class for both buttons
|
||||
if (isAtBottom) {
|
||||
if (backToTopBtn) backToTopBtn.classList.add('at-bottom');
|
||||
if (infoBtn) infoBtn.classList.add('at-bottom');
|
||||
} else {
|
||||
if (backToTopBtn) backToTopBtn.classList.remove('at-bottom');
|
||||
if (infoBtn) infoBtn.classList.remove('at-bottom');
|
||||
}
|
||||
// Show/hide back to top button + at-bottom positioning
|
||||
backToTopBtn.style.display = currentScroll > 300 ? 'flex' : 'none';
|
||||
backToTopBtn?.classList.toggle('at-bottom', isAtBottom);
|
||||
infoBtn?.classList.toggle('at-bottom', isAtBottom);
|
||||
|
||||
lastScrollTop = currentScroll <= 0 ? 0 : currentScroll;
|
||||
}, false);
|
||||
|
||||
// Back to top button click handler
|
||||
const backToTopBtn = document.getElementById('back-to-top');
|
||||
if (backToTopBtn) {
|
||||
backToTopBtn.addEventListener('click', function() {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
}
|
||||
// Back to top - now uses native anchor link with CSS smooth scroll
|
||||
// No click handler needed! Native <a href="#top"> with scroll-behavior: smooth
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user