Lazy loading of images

炎欲天舞
Release: 2017-08-04 14:54:59
Original
2038 people have browsed it

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++) {  }
Copy after login

Only set src as the image address. src is the image. The style when loading


 
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!