Created
July 31, 2019 19:21
-
-
Save naveed-ahmad/0902a5b096acd0349172c5c0f22d0779 to your computer and use it in GitHub Desktop.
IntersectionObserver.js
This file contains hidden or 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
root = document.querySelector('#shortcut-menu'); | |
element = document.querySelector("#render_async_bf86d55cff1564565792") | |
var observer = new IntersectionObserver(function(entries) { | |
console.log("interaction ", entries) | |
if (entries[0].intersectionRatio) { | |
console.log('visible'); | |
} else { | |
console.log('hidden'); | |
} | |
}, { | |
root: root | |
}); | |
observer.observe(element); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment