Intersection Observer & Efficient Scroll Handling

How can you detect when an element becomes fully visible?
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.intersectionRatio === 1) {
      console.log('Element is fully visible');
      trackFullVisibility(entry.target);
    }
  });
}, {
  threshold: 1.0
});
Next Question (15/20)