The 'back to top' button
Here is my tutorial on making a 'back to top' button without JavaScript. Please also refer to these very helpfu...
For further actions, you may consider blocking this person and/or reporting abuse
JS devs be like " where are my animationsssss"
You mean
html {scroll-behavior: smooth;}
?Haha! What kind of animations are you thinking about?
all those gimmicy animations, like lets a smooth scrolling to top (like a river :D) or an top arrow that changes color depending on how bottom we are on page etc!
Love the idea of colour changing when scrolling! Or perhaps fading in to full opacity as you get to the bottom...
well, it kind of works but messes up with browser history, user will have to click back button twice which is a bad UX, so just, please, stick to the js solution instead of link
Hey Vitaly! Thanks for your comment. What browser are you using?
href="#"
just navigates to the top of page, it doesn't add to the history in the browser which I should have mentioned in the article, I'll update that now. If you have any other reasons to suggest using JS on top of CSS I'd love to hear them.The question is more, what browser doesn't add it to the history? Both the latest Firefox and Chrome add # to the history.
Anyway, it's a good idea if you don't want to use onScroll event. You just can add a little bit JS to replace the link with a button.
Yep, that's what I've meant, when replacing js with css, do not forget about the UX
Noice
I like this! A couple of the websites I help manage has this effect, but I wasn't sure how it was achieved.
Very elegant : )
Very kind thank you!
Amazing! learned alot!