Skip to content

Preprocess Image for performance boost

Daybrush edited this page Jun 12, 2018 · 1 revision

The size of the image can not be known until the image is loaded. Therefore, you can not layout items because you can not know the size of the item until you know the size of the image.

If you set the image's width and height in advance, you can layout faster before the image loads.

How to use

<img src="..." alt="img" data-width="100" data-height="200"/>
  • You only need to add data-width and data-height attributes.