W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Re: lazy loading for images via css

From: Felipe Nascimento de Moura <felipenmoura@gmail.com>
Date: Fri, 28 Jun 2013 18:47:06 -0300
Message-ID: <CAJVBkVmAsGnAnWuCcK8o-30GkwE3BHjfXQx-ew9fAK9wJWSS2w@mail.gmail.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: www-style <www-style@w3.org>, brice@websailors.fr
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
as proposed by Sebastian Zartner.
background-image: url(mygreatestphoto.jpg) postponed;
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.


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
|  Power Polygon <http://github.com/braziljs/power-polygon>  |
TheWebMind<http://thewebmind.org/>  |
LinuxUser #508332
*Changing  the  world*  is the least I expect from  myself!
Received on Friday, 28 June 2013 21:48:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:31 UTC