Placeholder background/image while waiting for full image to load?

前端 未结 11 1618
栀梦
栀梦 2020-12-13 03:36

I have a few images on my page. I\'m finding that the page starts to render before the images have been loading (which is good), but that the visual effect is not great. Ini

11条回答
  •  爱一瞬间的悲伤
    2020-12-13 04:26

    There is a really simple thing to check before you start looking into lazy-loading and other JS. Make sure the JPG images you are loading are saved with the 'progressive' option enabled! This will cause them to load the image iteratively, starting with a placeholder that is low-resolution and faster to download, rather than waiting for the highest res data before rendering.

提交回复
热议问题