Here is a code snippet to make lightbox2 responsive.

Add this to your css file:

/* Responsive lightbox */
#lightbox2-overlay {width:100% !important;}
#outerImageContainer {
	max-width: 100%;
	height: auto !important;
	width: auto !important;
}
#imageContainer, #frameContainer, #modalContainer {
	height: auto !important;
	max-width: 100% !important;
}
#imageDataContainer {width: auto !important;}
#lightboxImage {
	height: auto !important;
	max-width: 100% ;
}

Comments

honza pobořil’s picture

Version: 6.x-1.9 » 7.x-1.x-dev
Issue summary: View changes

How about to make it active in D7 branch?

schtink’s picture

I am using the "Lightbox2 Lite" option and the following CSS works for me:

#lightbox2-overlay {width:100% !important;}

#lightbox, #lightboxImage, #lightboxDetails {
	max-width: 100% !important;
	height: auto !important;
	width: auto !important;
}
fabrizioprocopio’s picture

I tried tonight
the code seems not working
some help?

honza pobořil’s picture

Btw, I use now PhotoSwipe, it is perfectly responsive and operable by touch, keyboard and mouse.

fabrizioprocopio’s picture

I need something to use ovelay popup (really not the image)
and with lightbox2 overlays appears out of the mobile device screen

fabrizioprocopio’s picture

I tried to put the code above in the theme css
or else I have to put it somewhere else?