you need to add an event listener for the 'scroll' event. Evaluate the scroll position when it fires and update your target elements accordingly.