I have created the following liquid for the display of responsive images. It is intended to display the 720 pixel image below our media query break point of 720 pixels. It is incorrectly displaying that size at all widths, as confirmed in the network tab of developer tools.
to display the image because within this section of the website we are required to echo out the first and last images from each product. I am echoing out about ten images on the page using this code. I am also using
to display the last image from each product elsewhere.
I've tried using data-srcset (with data-src), but that does not resolve the issue.
Is the problem caused by the method with which I'm grabbing the image?
The images are included in a carousel, where the images slide in and out of visibility from right to left. Could that be causing the issue?
Alternatively, I've also tried using the image_tag filter, as below, to similar results.