I am trying to define a placeholder for when I click an image with photoswipe plugin. I would like to define 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 the different versions of my image.
My challenge is to get the current image displayed. For this, I use the currentSrc
property, which works fine on Firefox and Chrome, but not on Safari.
var currentSrc = imgEl.currentSrc || imgEl.src;
I didn't find anything about a possible solution for Safari & currentSrc
.