Created
January 21, 2020 16:41
-
-
Save simbathesailor/0ef2579026dc77ad78f5f571caf58551 to your computer and use it in GitHub Desktop.
intersectionobserver.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let options = { | |
root: document.querySelector("#scrollArea"), // null | |
rootMargin: "0px 0px 0px 0px", | |
threshold: 1.0 // [0, 0.25, 0.50, 0.75, 1] | |
}; | |
let observer = new IntersectionObserver(callback, options); | |
let target = document.querySelector("#listItem"); | |
observer.observe(target); | |
observer.unobserve(target); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment