A way to create a “back to the top” button that reveals when scrolling down and disappears at some point of the page when scrolling up
You can achieve this with Velo.
Hope this helps you:
Code:
const fadeOptions = {
duration: 200
}
$w.onReady(function () {
$w('#header').onViewportEnter(() => {
$w('#backToTop').hide('fade', fadeOptions);
})
$w('#header').onViewportLeave(() => {
$w('#backToTop').show('fade', fadeOptions);
})
});