Lazy loading background images to improve load time performance

👁 54 SzerzƑ: Fejes Dávid Frissítette: Fejes Dávid Frissítve:
#PHP #JavaScript

https://www.conroyp.com/articles/improve-load-time-performance-lazily-loading-background-images

loading=lazy is great for the src value of an image, but what about background images? These are typically declared via a background-image:url() css rule, which can't currently be controlled by a loading attribute. For background images use IntersectionObserver. This JS-based object is similar to the old js-based plugins hooked into scroll events.
HozzĂĄszĂłlĂĄsok
0 db
HozzĂĄszĂłlĂĄshoz jelentkezz be.
Még nincs hozzåszólås.