dmg media - JavaScript Developer Technical Exercise

This Javascript program tracks scroll depth through a news article webpage, when a user scrolls their window to 25%, 50%, 100% of the article body. It dispatches an event to the window object at each of these scroll offsets. The offset percentage is included in the details of the event.

How to test

  1. Open a web browser
  2. Navigate to the following page: https://metro.co.uk/2024/08/10/pointless-london-gallery-crowned-uks-biggest-tourist-let-down-21393090/
  3. Right click -> Inspect element -> Console tab -> Paste the code from index.js
  4. Start scrolling and see events and console message being triggered when you have scrolled 25%, 50%, 100% of the article body