lokesh / lightbox2

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

Inconsistent Image Sizing Under Bootstrap #623

Closed DiMono closed 5 years ago

DiMono commented 6 years ago

I have found on several websites I've made that are using jQuery, bootstrap, lightbox, and little else, that the full-size image will have identical dimensions to the outer container, meaning it extends 8px too far down and to the right. I have had to modify the width- and height-setting lines of Lightbox.prototype.sizeContainer() in seemingly random ways to resolve this:

For http://gridironplumbing.com and another site I'm currently building, I have to use width: newWidth + 8 (and same for height). This makes sense, because it's the difference between what it is and what it should be. However:

For http://primotendo.com/london/new/photos.php, I have to use width: newWidth + 0 (and same for height - it doesn't work properly without the + 0).

The sites are using 2.7.2, but I have tried replacing them with 2.10 and got the same result. I don't know if it's an incompatibility with something that's included in my code, but there's clearly something weird going on here. I wouldn't expect to have to modify the code for it to work as expected, and certainly not with + 0. Hopefully the specific websites I've linked to as examples will serve to help track down whatever is happening.

lokesh commented 5 years ago

Closing out older issues.

I suspected it might have to do with the parent page's CSS box-sizing property value being either content-box or border-box but that doesn't seem to be the case.

This issue might also have been resolved in a later version of Lightbox. I'm unable to recreate at this time.