I am trying to determine the placeholder when I click on an image using the photoswipe plugin. I would like to specify exactly the same version of my responsive image as the image displayed on my screen.
data-srcset="
http://url.com/img-240.jpg 240w,
http://url.com/img-360.jpg 360w,
http://url.com/img-480.jpg 480w,
http://url.com/img-720.jpg 720w "
Above are different versions of my image.
My task is to display the current image. To do this, I use a property currentSrc
that works fine on Firefox and Chrome, but not on Safari.
var currentSrc = imgEl.currentSrc || imgEl.src;
I did not find anything about a possible solution for Safari and currentSrc
.
source
share