, . CSS.
-, , (, display: none), , CSS, . ( devtools, , .) , , ( , ), . , , , .
JavaScript, :
- ( CSS)
- dynamically insert CSS property
backgroundinto elements immediately after loading is completed
Another solution would be to use lazy loading, in which instead of loading images in the background, you could start downloading images when you are (relatively) sure that the user will need to see a background image (for example, when the image is close to its position visible in the viewport).
source
share