lokesh / lightbox2

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

Provide a over-the-image (Facebook-like) caption mode #530

Open teo1978 opened 8 years ago

teo1978 commented 8 years ago

This is a feature request.

It would be nice to have an alternative mode for displaying captions. Of course this would be optional, one could choose between this and the current mode which is perfect in many cases.

This mode would work just like Facebook photo captions. Instead of displaying the caption below the image, taking screen space and forcing the image to be smaller, the image would occupy all the space that it can, and the caption would be displayed on top of the image (by on top I mean in a z-index sense), at the bottom. Of course there must be a way to hide it.

I would suggest to just mimic Facebook's behavior, which is perfect. It's more or less like this: On desktop:

On mobile:

Of course this means changing the current behavior that clicking anywhere on the image goes to the next one, which is not an issue because it is usually annoying and not desired anyway (you expect that to happen if you click somewhere near to the "next" button).

IF the enlarged image is small enough that enough space is available, the caption then should be displayed below the image even if this mode is enabled (or there could be a boolean option for whether you want this or not) because it wouldn't make sense to put the caption on top of the image if there is plenty of space to put it below it.

teo1978 commented 8 years ago

Note that this should be done in a way that does not prevent from fixing #524