0

How can I use Promises to load Images from IMG-srcset or from Picture-sources?
As far as I know, Browser decides which url (size) should be loaded.

How can I make this without setting the complete srcset/sources at once - which makes Promises useless for me?
Or is this a complete misunderstanding by my side?

user966660
  • 634
  • 1
  • 8
  • 20
  • The idea behind srcset *is* to have the browser decide. If you don't want the browser to do the deciding for you, don't use srcset. But you'll have to write your own code to perform what the browser is currently doing for you. – Heretic Monkey Jul 25 '18 at 21:11
  • Yes, this is ok - browser should decide. But how can I check if (specific resolution) Image is loaded (onload), to perform non-blocking JS (Promise?!)? Or should I set the whole srcset, picture sources at once? – user966660 Jul 25 '18 at 21:15
  • https://stackoverflow.com/help/how-to-ask – hcs Jul 25 '18 at 21:21

0 Answers0