Skip to content

Detect intersection by both `isIntersecting` and `intersectionRatio`

Compare
Choose a tag to compare
@tazsingh tazsingh released this 11 Dec 12:05
· 11 commits to master since this release

Previously we were only looking at the intersectionRatio being greater than 0 to detect an intersection. Now we also look at the isIntersecting property with a fallback to intersectionRatio > 0 in browsers that don't have the isIntersecting property.

Thanks to @Zubrolet for adding this and have a look at #19 for more information 👏