Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
177
rated 0 times [  178] [ 1]  / answers: 1 / hits: 16654  / 12 Years ago, mon, march 12, 2012, 12:00:00

I am curious about how lazy loading images, images that will be loaded when scrolled to them, works.



Any hint?


More From » image

 Answers
27

Here's a how-to, using plugins: http://www.webresourcesdepot.com/lazy-loading-of-images-resources-you-need/ here's the jquery plugin: http://www.appelsiini.net/projects/lazyload



basically you put a dummy image in your src attribute and add another attribute for the actual image, JS detects the scroll position of the page, and loads the image data once you get close enough to the image. it does that by replacing the src with the source of the actual image.



here's another explanation: http://engineering.slideshare.net/2011/03/faster-page-loads-with-image-lazy-loading/


[#86903] Saturday, March 10, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leog

Total Points: 225
Total Questions: 113
Total Answers: 118

Location: Oman
Member since Wed, Apr 12, 2023
1 Year ago
;