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.
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
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
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.