JQuery Lazy load Picture lazy loading

Source: Internet
Author: User

Portal: Official address, jQuery Lazy Load v1.7.2 Download, Github

How to use:

1. Reference JS file

<src= "Jquery.js"></script><  src= "Jquery.lazyload.js"></script>

2. Modify the IMG tags in the HTML code that need to be modified

<!-- The real picture address is written in the Data-original attribute, and the picture in the SRC attribute is replaced with a placeholder image (such as a 1x1 pixel gray picture or a loading GIF image) to add class= "lazy" to distinguish which images need to be loaded in time, and of course you Can be replaced by other keywords, modified at the same time remember to modify the JQuery selector when the call to add the width and Height properties to help when the picture is not loaded to fill the required space- <  class = "lazy" src = "Grey.gif" data-original = "Example.jpg" width = "640" Heigh = "480" >

3. Call the Lazy Load

$ (' Img.lazy '). Lazyload ();

JQuery lazy Load picture lazy loading

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.