Intersection Observer API

You can check about this API here. If it is not supported on the browser, we just go ahead and fetch the image for you.

How we implemented it:

let observer = new IntersectionObserver(entries => {
    let image = entries[0]

    if (image.isIntersecting) {
        //-----------------
        // Fetch Image here
        //-----------------
        observer.disconnect()
    }
})

observer.observe(this.image())

results matching ""

    No results matching ""