You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
Shrink browser viewport to a small size (i.e. 500px wide)
Click thumbnail to open fancybox (see that it displays the image "1_small_640x427" which is the correct and appropriate size for the viewport).
Click to zoom in on the image.
Expected behavior: The image should zoom in to show a much larger version of the image since larger sources are available via srcset.
Current / Problematic behavior: The image zooms in only slightly, and shows an enlarged (100% scale) version of the 640x427 source. The user doesn't really get to zoom in much more than a few pixels.
To emulate desired behavior using the codepen:
Make viewport very large
Click thumbnail to open fancybox (see that it displays "1_large_1600x800")
Shrink viewport to approximately 500px, with fancybox still open.
Click to zoom in
See image zooms in significantly to show original image at 100%.
More notes
When the user zooms in on the image, we would likely need to update the sizes property of the image to be specific pixel value to represent the new size we are zooming to. That way the browser will download a higher resolution source automatically. In other words, if we were able to zoom into a 3840px image then it would need to change from sizes="100vw" to sizes="3840px" when we zoom in.
The text was updated successfully, but these errors were encountered:
fancyapps
changed the title
srcset causes zoom in size to be limited
Zoom image to larger version from srcset
May 18, 2017
This is standard browser behaviour. When using srcset, once an image is loaded, resizing the window will not generate a new fetch as it increases bandwidth use. If you refresh the page or clear the cache it should load the expected image.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If using srcset, the ability to zoom in becomes limited.
Steps to re-create this issue:
Expected behavior: The image should zoom in to show a much larger version of the image since larger sources are available via srcset.
Current / Problematic behavior: The image zooms in only slightly, and shows an enlarged (100% scale) version of the 640x427 source. The user doesn't really get to zoom in much more than a few pixels.
To emulate desired behavior using the codepen:
More notes
When the user zooms in on the image, we would likely need to update the
sizes
property of the image to be specific pixel value to represent the new size we are zooming to. That way the browser will download a higher resolution source automatically. In other words, if we were able to zoom into a 3840px image then it would need to change fromsizes="100vw"
tosizes="3840px"
when we zoom in.The text was updated successfully, but these errors were encountered: