Back Tolerance Area (Tolerance = 100px)

Initially no options are passed to isInViewport().

Hence all visible div(s) are light grey coloured.

onscroll, isInViewport() is called with tolerance as 100

and debug as true for the div with class `js-hook` ie the 2nd div.

Therefore 2nd div turns light grey only when it is inside tolerance area.

2

3

4

JavaScript scaricato da HTML.it