Skip to main content
100%

JS Bin

✓ Published0🌍 Public
JJaloYang
Last edited May 5, 2020
Created on May 5, 2020
Forked from Untitled

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 description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes