JS Bin
✓ Published0🌍 Public
This example demonstrates scroll-position detection within a fixed-height container using vanilla JavaScript. The page defines two nested divs: an outer scrollable `divContainer` with a 200-pixel height and an inner `divContent` containing twelve sample paragraphs. When the user scrolls to the bottom, the code triggers an alert and dynamically expands the inner div’s height to 1000 pixels. The implementation relies on the container’s `onscroll` event handler and compares `scrollTop`, `scrollHeight`, and `offsetHeight` properties to determine when the bottom is reached.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed