Skip to content

Instantly share code, notes, and snippets.

@zeusdeux
Created May 13, 2018 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeusdeux/82e8871de31819f0a0b19dd150f87fc5 to your computer and use it in GitHub Desktop.
Save zeusdeux/82e8871de31819f0a0b19dd150f87fc5 to your computer and use it in GitHub Desktop.
IntersectionObserver weirdness
// navigate to https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#Intersection_observer_concepts_and_usage
// open console and run the code below
const target = document.getElementById('How_intersection_is_calculated')
const observer = new IntersectionObserver(entries => console.log(entries[0], entries[0].isIntersecting), {root: null, threshold: 0.9})
observer.observe(target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment