In my Angular application, the main navigation consists of a standard toolbar positioned at the top of the page.
My goal is to have this navigation bar smoothly scroll up with the user as they scroll down, and then reappear when they scroll back up.
I attempted to achieve this functionality using window.pageYOffset
, but I encountered an issue where this value always remained 0
. Additional details on this can be found here.
For reference, I have created a Stackblitz demo showcasing my current set up for the navbar, which can be viewed here.