Someone previously introduced images lazyload in the blog Park. Today, I accidentally found the jquery lazyload plug-in, which is very convenient.
Lazy load plugin for jquery detailed introduction and use methods see http://www.appelsiini.net/projects/lazyload
For example:
Simple View Mode
Copy to clipboard
Print
- // Use the current window as the visible area and dynamically load all images whose class is thumb
- $ (". Thumb"). lazyload ({// select all images
- Placeholder: "img/grey.gif", // The image before loading. It can be a loading image.
- Effect: "fadein" // Effect of image loading
- });
// Take the current window as the visible area and dynamically load all images whose class is thumb $ (". thumb "). lazyload ({// select all images placeholder: "img/grey.gif", // The image before loading, which can be a loading effect: "fadein" // The effect when the image is loaded });
// Use the ID as the iner as the visible area to dynamically load all images
Define a container first
- # Container {
- Height: 600px;
- Width: 600px;
- Overflow: Scroll;
- }
First define a container # container {Height: 600px; width: 600px; overflow: Scroll ;}
Simple View Mode
Copy to clipboard
Print
- $ ("IMG"). lazyload ({
- Placeholder: "img/grey.gif ",
- Container: $ ("# container ")
- });