Welcome to my first post here! I've received so much valuable help from this forum and the posts of other users. However, there's one question that I can't seem to find an answer for. Here it is:
I have a button that, when pressed, smoothly scrolls the user back up to the top of the page. I've successfully made it fixed at the top of the screen. But let's say you're at the bottom of the page and press the "smooth-scroll" button. It starts scrolling you upwards, but as you get "near" the top, I want the button to stop moving while the scrolling continues...
It's hard to describe, but imagine starting at the top of the page where you don't see the button. As you scroll down, the button appears and moves upwards until it reaches the top of the screen and stays fixed there.
I'm sure this effect is common in ads, for example...
How would you go about achieving this? Any help would be greatly appreciated.
Thank you,
Layman