Closed MarPostovik closed 7 months ago
Hey @naumch1k , I think I've found the solution. I've added attribute loading="lazy"
both for <img>
and <source>
. This attribute tells browser, that image should be loaded only when it appears on screen. So, as it never appears on the screens smaller than 660px, it is never loaded on these screens. You can read this article about loading="lazy"
if you want.
@MarPostovik Wow, what a brilliant idea! 😍 Your solution using the lazy loading technique is elegant and effectively addresses the problem!
I have a small suggestion here. Since lazy loading is applied to the <img>
tag, there's no need to duplicate it on the <source>
tag. Similar to attributes like alt
and class
, specifying it once on the <img>
tag suffices and automatically applies to the associated <source>
tag.
I tested this solution by removing the loading="lazy"
attribute from the <source>
tag, and it works perfectly across different browsers - Chrome, Safari, and Firefox.
After you've done that, we will all be good to merge 😉
Once again, outstanding job!
Done ✅
Description
This pull request resolves #23
Changes Made
In the element
research__image
of BEM blockresearch
changed themedia
in tag<source>
frommax-width: 660px
tomax-width: 1199px