This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4106|Reply: 2

[Jquery] jQuery image lazy loading lazyload plugin

[Copy link]
Posted on 4/5/2023 8:17:05 PM | | | |
Requirements: There are too many images on the HTML page, if the user visits for the first time, it will be very slow, because it needs to load hundreds of images, and I found some lazy loading solutions for lazy loading of images from the Internet, the principle is that the img tag src address is set to the same address, and then data-xxx sets the real image address, when the page is loaded, traverse all the img tags, and replace the data-xxx address with the src address.



lazyload plugin address:The hyperlink login is visible.

Download:


lazyload-1.9.7.zip (781.69 KB, Number of downloads: 1)

Use the tutorial

Set the real image address in the data-original attribute as follows:

Then, call the js code like this at the bottom of the HTML:

(End)




Previous:The Cassowary tool for HTTP request stress testing
Next:[Actual combat]. NET/C# to get JD.com's product details pictures
Posted on 4/5/2023 10:19:43 PM |
Learn to learn
Posted on 4/22/2023 1:51:02 PM |

Learn to learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com