Skip to content
Advertisement

I coded lazy loading for videos, background images and images but it didn’t work on safari

I coded lazy loading for videos, background images and images but didn’t work on ios safari.

I want show the background images/images/video with IntersectionObserver method.

below codes are for background image and video.

JavaScript

and this is my JS =

JavaScript

-Is there a way to modify this code in ios Safari?

  • Also this codes didn’t work on the Firefox.

Advertisement

Answer

item.target.ariaLabel is availbale in v8 engine (chrome). hence I changed it to item.target.getAttribute('aria-label')

now it works.

Advertisement