Re: lazy loading for images via css

>
>  > 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.
>>
>> Yeah, I'm potentially interested in pursuing something to indicate a
>> lazy-loaded image in CSS as well.  We can bake it into image(), which
>> is designed to have its set of annotations expanded over time.
>> "background-image: image(defer "foo.jpg");" or the like.
>>
>> ~TJ
>>
>
> interesting...that could also be an option!
> although I still think it would be easier, or simpler to use something like
>
>  body.mobile div{
>      background-load-method: postponed;
> }
>
> For situations like that, we are not specifying the image itself, just
> saying(in a more "cascade" mode) how backgrounds for those selectors should
> behave!
>
> Supporting background-image: image(postponed "foo.jpg"); would, indeed, be
> other great option to specify the same property.
>
> Therefore, I think it would be highly adopted by developers if browsers
> could support all
> background-load-method: postponed;
> background-image: url(mygreatestphoto.jpg) postponed;
> background-image: image(postponed "foo.png");
>

You want the lazy loading for the image, not for other backgrounds (like
gradients), so Tab's idea sounds more logical to me to bind it directly to
the image.

Sebastian

Received on Saturday, 29 June 2013 07:24:09 UTC