I see. The problem with the msrc:
parameter is, that it does not work well when the thumbnail is not the same aspect ratio as the linked image.
Also see the FAQ of PhotoSwipe about this, section “My thumbnails are square, but large images have different dimensions …”:
https://photoswipe.com/documentation/faq.html
As an example see this gallery on my website with the msrc:
parameter added (I’ll remove that modification in a couple of days):
https://arnowelzel.de/en/back-from-finland
The thumbnails are squares, the large pictures not. So when you click a thumbnail, you can see how the thumbnail will be distorted until it fills the final image size – which is not a square. You can see how weird the picture looks for a moment before the higher resolution image will be loaded and “snaps” into place. I decided having a grey background is better then this weird animation.
Therefore I think a better approach might be to remove the grey background during the loading sequence within PhotoSwipe. You can do this by adding display: none
to the basic PhotoSwipe UI CSS (lib/photoswipe.css
):
.pswp__img--placeholder--blank {
background: #222;
display: none; }
(I mentioned opacity: 0
before, but hiding the whole placeholder is better).
You can see this in action here:
https://criticalmass-augsburg.de/mai-2018-ueber-220-mitfahrer-innen
I will include this in the next update.
-
This reply was modified 5 years, 11 months ago by Arno Welzel. Reason: Changed suggestions for hiding the image placeholder