If this event handler doesn't necessarily need to control the event execution, it's a good idea to put this function into a "debounced" callback (think `setTimeout`; see `navigation.js` for scroll event example). This way the calculations this function does, does not interfere with the browser actually scrolling the content.