jquery image the use of delay-loaded plug-in jquery.lazyload.js _jquery

Source: Internet
Author: User

The latest version of Jquery.lazyload.js is no longer pseudo deferred loading

One, please follow the basic use method to explain the setting

Copy Code code as follows:

Loading JavaScript files
<script src= "Jquery.js" type= "Text/javascript" ></script>
<script src= "Jquery.lazyload.js" type= "Text/javascript" ></script>

Copy Code code as follows:

The 4 attributes of an IMG tag can be less than one, otherwise the effects of deferred loading are not implemented as follows:

Copy Code code as follows:

Use
$ (function () {
$ ("Img.lazy"). Lazyload ();
});

Second, the commonly used attribute description

Copy Code code as follows:

THRESHOLD:200//Set sensitivity, means to enter the display area and 200 pixels to start loading
Effect: "FadeIn"//Using Fade effect
FAILURE_LIMIT:10//Tolerance range, be sure to set this value, the reason for the description please refer to the original document

Container: $ ("#container")//using parent container, the CSS style of the parent container should contain at least "Height:600px;overflow:scroll" Two properties

Event: "Click"//Modify trigger event to click

Third, the reference

English reference: Http://www.appelsiini.net/projects/lazyload

Chinese reference: http://code.ciaoca.com/jquery/lazyload/

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.