Created
June 26, 2018 22:07
-
-
Save CristinaSolana/754139891b5b4462cfd5e0b812944169 to your computer and use it in GitHub Desktop.
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
const options = { | |
root: null, // use null for viewport | |
rootMargin: '0px', | |
threshold: 1.0 | |
}; | |
const observer = new IntersectionObserver(callback, options); | |
const target = document.querySelector('#someSection'); | |
observer.observe(target); | |
function callback(entries, observer) { | |
// fetch some data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment