lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.22k stars 1.77k forks source link

Wrong height with max-height 100% #478

Closed mpskovvang closed 8 years ago

mpskovvang commented 9 years ago

Hi,

Thanks for a great lightbox library!

Just a little heads up. If your stylesheet contains something like this:

img {
    max-height: 100%;
}

The lightbox will never use the right image height, as the default 250x250px contianer forces the image height to 250px and afterwards the code uses the image element's height to adjust the container size.

Suggestion: Either the lightbox stylesheet can override the image max-height or the javascript can use the preloader height instead of image element's height - just a quick thought.

khuramali123 commented 8 years ago

Hi, you remove this css img { max-height: 100%; }

lokesh commented 8 years ago

Good catch!

I've added a max-height: none; to the lightbox image css rule to override any max-height that was set outside the script.