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() {
55
55
// document bottom
56
56
let windowRelativeBottom = document .documentElement .getBoundingClientRect ().bottom ;
57
57
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> ` );
63
63
}
64
64
}
65
65
```
You can’t perform that action at this time.
0 commit comments