Open RafaPolit opened 6 years ago
Sounds like adding two new data-* attributes is the best thing to do, and then in the _resize
method check that the attribute value is < maxHeight
and width
and use which ever is most appropriate.
Yeap, I have implemented that approach in a pull request (with added options in the example HTML file), and also improving a bit some padding / aspect ratio issues.
I am showcasing images optimized for retina displays (@2x) which are 2400px width, forced to display at 1200px.
When I refernce those images inside lightbox, setting the "width" option to a size SMALLER than the image file has no effect. It only works for EXPANDING original image files, but larger files are not scaled down.
What I really would want is to have a 'max-width/max-height' option that will allow for the modal to be as small as needed and grow no further than XXX pixels, to keep image display to its best.
Thanks, Rafa.