We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ba6ae24 + 8a70b74 commit 1bd9b9eCopy full SHA for 1bd9b9e
1 file changed
2-ui/3-event-details/8-onscroll/1-endless-page/solution.md
@@ -55,11 +55,11 @@ function populate() {
55
// document bottom
56
let windowRelativeBottom = document.documentElement.getBoundingClientRect().bottom;
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
- }
+ // if the user hasn't scrolled far enough (>100px to the end)
+ if (windowRelativeBottom > document.documentElement.clientHeight + 100) break;
+
+ // let's add more data
+ document.body.insertAdjacentHTML("beforeend", `<p>Date: ${new Date()}</p>`);
63
}
64
65
```
0 commit comments