I have following code in my app:
<picture>
<source media="(max-width: 1300px)" srcSet={src.img['1']} />
<source media="(max-width: 1599px)" srcSet={src.img['2']} />
<source media="(max-width: 2049px)" srcSet={src.img['3']} />
</picture>
is it possible programmatically to check which of these images was loaded by browser in picture element? I have to use that image once again (now I use img['1'] by default in tooltip) but I want to avoid loading image one more time.
Include the <img> tag inside <picture> and check its currentSrc property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With