It conflicts with Javascript scroll to top
window.scrollTo(0,0 ) I had been making a trade-off between a scroll to top button and scroll padding, please respond if there is a way to resolve this conflict
window.scrollTo(0,0 )
My idea would be to calculate the height of your header/navigation (with JS) and scroll to that position. If your header is 100px height, then scroll to 100px on the Y axis instead of 0. That's the only idea I have currently :/
You can set the scroll-behaviour to smooth on the html element, and keep it CSS only, don't need JS anymore: developer.mozilla.org/en-US/docs/W...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It conflicts with Javascript scroll to top
window.scrollTo(0,0 )I had been making a trade-off between a scroll to top button and scroll padding, please respond if there is a way to resolve this conflict
My idea would be to calculate the height of your header/navigation (with JS) and scroll to that position. If your header is 100px height, then scroll to 100px on the Y axis instead of 0. That's the only idea I have currently :/
You can set the scroll-behaviour to smooth on the html element, and keep it CSS only, don't need JS anymore: developer.mozilla.org/en-US/docs/W...