File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
2-ui/3-event-details/8-onscroll/1-endless-page Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ function populate() {
5555 // document bottom
5656 let windowRelativeBottom = document .documentElement .getBoundingClientRect ().bottom ;
5757
58- // if the user scrolled far enough (< 100px to the end)
59- if (windowRelativeBottom < document .documentElement .clientHeight + 100 ) {
60- // let's add more data
61- document . body . insertAdjacentHTML ( " beforeend " , ` <p>Date: ${ new Date () } </p> ` );
62- }
58+ // if the user hasn't scrolled far enough (> 100px to the end)
59+ if (windowRelativeBottom > document .documentElement .clientHeight + 100 ) break ;
60+
61+ // let's add more data
62+ document . body . insertAdjacentHTML ( " beforeend " , ` <p>Date: ${ new Date () } </p> ` );
6363 }
6464}
6565```
You can’t perform that action at this time.
0 commit comments