Skip to content

Commit 171c750

Browse files
committed
Update index.html
1 parent 6c4fb2d commit 171c750

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,9 @@ <h2 class="color-1 weight-title-h font-title section__title center">A codeful of
341341
const elemTop = rect.top;
342342
const elemBottom = rect.bottom;
343343

344-
// Only completely visible elements return true:
345-
//const isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);
344+
const height = 51.4; // el.clientHeight;
346345

347-
// Partially visible elements return true:
348-
let isVisible = (elemTop + (el.clientHeight / 2) + 20) < window.innerHeight;
346+
let isVisible = (elemTop + height) < window.innerHeight;
349347

350348
return isVisible;
351349

0 commit comments

Comments
 (0)