Re: lazy loading for images via css

Hi.
Yes, that's true, although most of(if not 99%) implementations "out there"
do it the bad way :/
Brice Parent gave another interesting idea, of using
async="none|async|postponed|..." in loadable elements(such as images,
object, video, iframe...) as an attribute, like
<img src="photo.png" alt="photo!" postponed/>

In this case, I believe we should discuss it with HTML list's people, right?

Also, it would be really interesting to use as another background
characteristic,
as proposed by Sebastian Zartner.
Like
background-image: url(mygreatestphoto.jpg) postponed;
or
background-load-method: postponed;

With that, we would even be able to say that:

body.mobile div{
     background-load-method: postponed;
}

this way, a server side application could write the body tag with or
without the "mobile" class, therefore, all the div elements with background
images would be postponed to load their background.

Regards.





On Fri, Jun 28, 2013 at 8:01 AM, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:

> * Felipe Nascimento de Moura wrote:
> >I mean, nowadays websites use it to avoid unnecessary image loadings...but
> >they sacrifice(a lot of) the performance! It's a javascript running for
> >each scroll event, usually running through all the images in a loop to see
> >which ones are in the current visible viewport! (it is terrible or is it
> >just me?!)
>
> That certainly would be terrible if so, but I do note that this could be
> optimised considerably easily. For instance, a Quadtree could be used to
> limit the number of images in the inner loop.
> --
> Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
> Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
> 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
>



-- 
*Felipe N. Moura*
Senior Web Developer

Website:  http://felipenmoura.org
 Twitter:    @felipenmoura <http://twitter.com/felipenmoura>
LinkedIn: http://goo.gl/qGmq

Meet some of my projects:
BrazilJS Conference <http://braziljs.com.br/>  |  BrazilJS
Foundation<http://braziljs.org>
|  Power Polygon <http://github.com/braziljs/power-polygon>  |
TheWebMind<http://thewebmind.org/>  |
PHPDevBar<https://addons.mozilla.org/pt-BR/firefox/addon/php-developer-toolbar/>
---------------------------------
LinuxUser #508332
*Changing  the  world*  is the least I expect from  myself!

Received on Friday, 28 June 2013 21:48:16 UTC