Skip to content

Commit

Permalink
Fix: scrollHeight example (#36440)
Browse files Browse the repository at this point in the history
* Fix: scrollHeight example

* Update files/en-us/web/api/element/scrollheight/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update index.md

* Fix: Code alignment

* Update files/en-us/web/api/element/scrollheight/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ragul1697 and github-actions[bot] authored Oct 24, 2024
1 parent cadc98b commit 59d50a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/en-us/web/api/element/scrollheight/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ const veryImportantRead = document.getElementById("very-important-read");
// Check if user has scrolled the element to the bottom
function isRead(element) {
return (
element.scrollHeight - Math.round(element.scrollTop) <= element.clientHeight
Math.abs(element.scrollHeight - element.clientHeight - element.scrollTop) <=
1
);
}

Expand Down

0 comments on commit 59d50a9

Please sign in to comment.