Utilizing the Intersection Observer API, I can accurately determine whether an element is within the viewport or not.
Is there a way to utilize the Intersection Observer API to detect if an element is in the viewport without relying on a callback function?
For example:
let options = {
root: ..
rootMargin: '0px',
threshold: 1.0
}
let observer = new IntersectionObserver(callback, options);
const status = observer.isInViewport(); // <------- this is my desired functionality or something similar, no callback required.