Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How are the photos load slowly? For instance, Facebook photos are loaded first, and then gradually become full.
Posted
Comments
joshrduncan2012 26-Mar-13 16:13pm    
Huh?

1 solution

There are several approaches to achieve this.
There is an attribute of IMG tag called lowsrc. It was meant to be loaded first, than replaced by the image in the src attribute. Unfortunately, modern browsers are ignoring it; still you can make it work with javascript, see: http://blog.throbs.net/2009/05/27/Hey+JLo+Where+Did+LowSRC+Go.aspx[^];
An other approach is even better: the full-res images are loaded only when the image is scrolled in the viewport: http://www.appelsiini.net/projects/lazyload[^]
You can also rely on jpg itself: http://calendar.perfplanet.com/2012/progressive-jpegs-a-new-best-practice/[^], but the support is not the same across browsers.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Mar-13 17:26pm    
Good points, a 5.
—SA
Zoltán Zörgő 26-Mar-13 17:30pm    
Thank you.
Bernhard Hiller 27-Mar-13 3:46am    
The "progressive rendering" is surely the feature requested here. It was used with gif already more than a decade ago, when slow modem connections were normal, and 120 kB took a minute to load...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900