Skip to content

Instantly share code, notes, and snippets.

@agneym
Created June 30, 2018 15:57
Show Gist options
  • Save agneym/7ff4467c8c6ab17e438111d179b3ab96 to your computer and use it in GitHub Desktop.
Save agneym/7ff4467c8c6ab17e438111d179b3ab96 to your computer and use it in GitHub Desktop.
const observer = new IntersectionObserver(callback);
const target = document.querySelector('#target');
observer.observe(target);
function callback(entries) {
// Do action here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment