Building a Media Player #9: Lazy-Loading Images

Building a Media Player #9: Lazy-Loading Images

Chrome for Developers

7 лет назад

17,065 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@rongsenng
@rongsenng - 10.03.2017 20:27

any chat on the accessibility?

Ответить
@snapstromegon
@snapstromegon - 10.03.2017 20:41

Just a short question on your style of coding: Was it on purpose, that you add the "js-lazy-image--handled" class in line 86 of lazy-load-images.js via text and not by using LazyLoadImages.HANDLED_CLASS ?

In my opinion it would be more elegant and future-proof to use the attribute you already created for this use.

Ответить
@08twistedfork
@08twistedfork - 10.03.2017 20:51

y not just unobserve the entries once the IO callback is called?? Then maybe we won't need the tagged class thingy?? just thinking out loud...

Ответить
@BirkirRGujonsson
@BirkirRGujonsson - 10.03.2017 20:54

Hey, why don't you use the `unobserve` method to stop observing loaded images?

Ответить
@JonathanHodgson
@JonathanHodgson - 10.03.2017 21:17

Do you add the src to a data-src attribute or something or do you unset the src attribute before the images have loaded? I have always been put of lazy loading images because they require the user to have JavaScript on. Have you got a work around for this?

Ответить
@GilGoldshlager
@GilGoldshlager - 10.03.2017 21:23

Nice :)
Can you please give a proper title to each video for it will be easier to find it later? for example the current title doesn't even have anything to do with this video.

Ответить
@rlamacraft
@rlamacraft - 12.03.2017 12:59

will be so nice when stuff like this can be bundled into a reusable Web Component…

Ответить
@mehrandjalalibehzad2985
@mehrandjalalibehzad2985 - 12.03.2017 21:21

@Paul, Would you suggest using the IntersectionObserver polyfill from WICG? or rather stick to a custom scroll event handler for this use case?

Ответить
@somedud3720
@somedud3720 - 13.03.2017 17:21

What are the underscores from? Are you using underscore library?

Ответить
@benschramm5403
@benschramm5403 - 26.03.2017 04:55

PLAYYYYERR NIIIINNEEE

Ответить
@powerademonke
@powerademonke - 06.10.2017 00:18

Does anyone know if the IntersectionObserver API can be applied to iFrames and embeded videos?

Ответить
@AstroSirrus
@AstroSirrus - 22.05.2021 17:32

This is awesome! How do I lazy load with dominant color?

Ответить