I’m using http://lokeshdhakar.com/projects/lightbox2/. I have image thumbnails and on clicking them they open in lightbox – obviously.
The issue I have is that when some of those images are 1800×1200, lightbox covers the whole webpage.
How can I edit to ensure that the images are a maximum height of let’s say 400px and width is in proportion? I can’t simply upload the images in lower dimensions as they are user uploaded images, so I need to do this script/server side.
Thanks!
You can use the
max-widthandmax-heightCSS properties on both the images and the lightbox:Demo: http://jsfiddle.net/rdfAV/1/
CSS:
This method appears to be compatible with all major browsers, a full compatibility list is available here: http://caniuse.com/#feat=minmaxwh