I would like to have two sizes of images, for small and large screens.
With fancybox, I'm using the srcset attribute to change the fullview image as described in the fancybox demo, with something like this :
<a data-fancybox="test-srcset"
data-type="image"
href="img1200px.jpeg"
data-srcset="img1200px.jpeg 1200w,
img640px.jpeg 640w"
>
<img width="250" src="img250px.jpeg" />
</a>
Full example from fancybox : https://codepen.io/anon/pen/wNdyYm?editors=1000
On mobile for my pages, I've set up the meta :
<meta name="viewport" content="width=device-width" />
But with fancybox, there is no option to set it, and the high definition is loaded (1200px) instead of the small one on mobile.
What can I do ? Is there any jQuery hack or anything else ?
Thanks
Actually, the script sets same
srcsetvalue to image tag, the rest is up to the browser. But there is inconsistency across browsers about how they choose what source to use, for example, see this demo https://codepen.io/fancyapps/pen/LJwvzY?editors=1000 on chrome and ff, and try resizing on both of them.