Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test() {
- const elm = document.querySelector('.panel');
- const options = {
- root: null,
- rootMargin: '0px',
- threshold: 0}
- observer = new IntersectionObserver(elements => {
- elements.forEach(element => {
- if(element.intersectionRatio > 0) {
- var intersectionRatio = element.intersectionRatio;
- var isIntersecting = element.isIntersecting;
- var time = element.time;}
- });
- });
- observer.observe(elm );
- return time;}
- VM32254:16 Uncaught TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.
- at test (<anonymous>:16:14)
- at <anonymous>:1:1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement