Background: Sometimes we don’t need to load all the pictures when we open a page. We hope that they will be loaded only when the pictures are to be displayed on the page. Taobao is a good example. When we slide the page, which picture should we slide to? Only one picture will be loaded, which saves the user's mobile phone traffic.
Upload the code
@for (int i = 3; i < 22; i++) { }
Only set src as the image address. src is the image. The style when loading
is not very simple!
The above is the detailed content of Lazy loading of images. For more information, please follow other related articles on the PHP Chinese website!