I manage 15 websites for a specific client.
I received new photos (to be uploaded to the website) from the client last night.
Today. I received a message about the new responsive image feature.
This feature will break an exported site that uses JQuery to dynamically load images.
ie: a LightBox
This is the line of code it creates… notice the new “
srcset” and “
<img alt="q" class="selected-image" id="the-image" sizes="(max-width: 767px) 87vw, (max-width: 991px) 596px, 808px" src="../photo-images/pqc-16091403-opz.jpg" srcset="../images/pqc-16091401.jpg 500w, ../images/pqc-16091401.jpg 800w">
My code dynamically changes the
src (image source) - depending on the viewers thumbnail selection.
src (image source value) changes correctly (when inspected)…
but somehow this new
srcset (source set) will not allow the image the change.
NOTICE HOW SRC IS DIFFERENT THAN SRCSET AFTER THE DYNAMIC CHANGE:
src="../photo-images/pqc-16091403-opz.jpg" srcset="../images/pqc-16091401.jpg 500w, ../images/pqc-16091401.jpg 800w"
Now I have to figure out a quick fix - since the client was expecting the update to be live @50pm EST… 2 and 1/2 hours from now.