I'm currently facing an issue with the Intersection Observer API. My goal is to trigger an animation when the intersectionRatio reaches at least 40%. Here's the code I'm using:
if(entry.intersectionRatio > 0.40){
DO SOMETHING
}
However, I keep getting intersection ratios like "0.0xxxx" or even lower than "0.00xxxx". For instance, right now, I'm seeing an intersection ratio in the console as 0.007672634441405535. While I could try using these values to trigger my animations, they are highly unpredictable and the element never fully comes into view since it never reaches an intersectionRatio of 1, even when it's completely visible. I want to identify the error and learn how to rectify it. I'm utilizing Bootstrap, and removing the framework's scripts did not resolve the issue.
You can check out the website; the section I'm referring to is the cards below the "Meet the team" title. The script I have will log the intersection ratios of the card elements to the console when you scroll to that section.
Thank you for your assistance.