From 59d50a9b94240beb310ef06fb05e7438c7d3c18c Mon Sep 17 00:00:00 2001 From: Ragul <67683723+ragul1697@users.noreply.github.com> Date: Fri, 25 Oct 2024 04:09:24 +0530 Subject: [PATCH] Fix: scrollHeight example (#36440) * 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> --- files/en-us/web/api/element/scrollheight/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/api/element/scrollheight/index.md b/files/en-us/web/api/element/scrollheight/index.md index 5b6920da6e0b16d..1981092127f1505 100644 --- a/files/en-us/web/api/element/scrollheight/index.md +++ b/files/en-us/web/api/element/scrollheight/index.md @@ -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 ); }