banthagroup / fslightbox

An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.
MIT License
351 stars 30 forks source link

Add support for image srcset #117

Closed pvonseth closed 4 years ago

pvonseth commented 4 years ago

Especially on mobile it would be a performance advantage if the Lightbox would supports the img srcset and thus reduces the loading time for the user.

banthagroup commented 4 years ago

Since 3.2.0 there are available custom attributes. You can add srcset using data- prefix: <a data-fslightbox="gallery" data-srcset="img/second.jpg 2x, img/third.jpg 3x" href="first.jpg"></a>