The latest version of jquery. lazyload. js is no longer a pseudo-delayed loading.
1. Please follow the basic instructions
Copy codeThe Code is as follows:
// Load the JavaScript file
<Script src = "jquery. js" type = "text/javascript"> </script>
<Script src = "jquery. lazyload. js" type = "text/javascript"> </script>
Copy codeThe Code is as follows:
// Each of the four attributes of the img tag must be unique. Otherwise, the delayed loading effect cannot be achieved, as shown below:
Copy codeThe Code is as follows:
// Use
$ (Function (){
$ ("Img. lazy"). lazyload ();
});
Ii. common attributes
Copy codeThe Code is as follows:
Threshold: 200 // sets the sensitivity, indicating that loading starts when the display area is still 200 pixels long.
Effect: "fadeIn" // use the fade-in special effect
Failure_limit: 10 // tolerance range. You must set this value. For the reason, see the original document.
Container: $ ("# container") // use the parent container. The CSS style of the parent container should contain at least "height: 600px; overflow: scroll;" two attributes.
Event: "click" // modify the trigger event to click
Iii. References
Http://www.appelsiini.net/projects/lazyload:
Http://code.ciaoca.com/jquery/lazyload/