Is there a way to trigger an event when the page's scroll position changes?
I'm interested in creating a dynamic table of contents similar to (where the active item changes as you scroll).
Can this be achieved without directly accessing the current scroll position?
I am just beginning to learn about JavaScript and web development.