Re: lazy loading for images via css

Le 01/07/2013 19:26, Liam R E Quin a écrit :
> On Mon, 2013-07-01 at 10:18 -0700, Tab Atkins Jr. wrote:
>
>>> I wonder if an alternative would be an on-demand( <url> ) function that
>>> could go anywhere that url() can go today? Then it could work for
>>> sounds, or other resources.
>>
>> Yes, this is another direction we could take.  Only issue I have with
>> this is that the most common case for urls in CSS is images,
> Right.
>
>> We could do both, treating the defer as a property of the url, such
>> that applying it via either method works, even when combined.  Or we
>> could just do images for now, and wait for demand for other types of
>> urls to add the more generic solution?
> I don't have strong feelings, just wanted to make sure the more generic
> version was considered. I do think we'll see more resource types in the
> future but supposition can't get in the way of practice.
>
> For the background image example you give, I can imagine having only
> some images as marked "defer", e.g. that are likely to be off-screen
> before scrolling. But maybe that's not necessary, marking them all as
> defer would be sufficient, since the browser can't actually tell which
> ones it needs and when until it knows their sizes.

Also: images are deferred until they are scrolled into view, but it may 
not be as obvious to define what "defer" means for other types of resources.

-- 
Simon Sapin

Received on Monday, 1 July 2013 18:40:37 UTC