Within my side navigation bar, there is a title and other information. The title is fixed in place (sticky) and the sidebar has a height of 100vh. I am looking to add a box-shadow
effect to the title div (sticky-title
) only when the user scrolls down past the 100vh mark. Essentially, I want the box-shadow property to appear only after the user has scrolled beyond the initial viewport height. I attempted to use a scroll EventListener, but it seems to be referencing the main window's scroll position rather than that of the sidebar div.
For reference, you can find a link to the code sandbox playground below: