NOTICE
CONTENTS NO LONGER APPLICABLE
The content discussed in this post is no longer valid; as I’m now using a different “lightbox” implementation.
More here
When opening an image via lightbox, closing an image can get very counter intuitive. The close button is at the bottom right, which sucks if you have an image that’s larger than the viewing area. Trying to move that close button on the upper right can be too tedious as it requires a lot of modification on the DOM script and CSS. The easier thing would be to simply allow users to close the image when they click on it, after all, what else does one person usually do after viewing an image but close it right?
A hack for this is easy to do, however this usually broke Lightbox‘s “group” mode – instead of moving to the previous/next image, it prioritizes the close function assigned to the image container instead of the group mode’s prev/next overlays – resulting in the image closing anywhere you click.
The trick was to find another place where I could inject similar code, while making sure that it only does it when it’s viewing a single image. Read More

