Finding the Perfect Lightbox

Posted: May 19th, 2009 | Author: | Filed under: JS | Tags: , | 3 Comments »

I need a proper lightbox. Now there are plenty of lightboxes out there that should satisfy my needs, but I could not find the perfect fit. My ‘demands’ are as follows:

  • Flawless (X)HTML, also the generated code
  • Can be used to display images, partial HTML, hidden content from same page, iframes (for form processing) and request contents with AJAX.
  • auto adjust size to contents, unless overruled by settings.
  • Easily styled through external CSS (I do not want to apply styles using JS)
  • Can group images into sets and navigate through them
  • Stacking of boxes (open lightbox from within a lightbox)
  • jQuery may be used, but no other library (as it is already available in this specific project)

The Lightbox Matrix provides an easy tool to compare features, but still requires some investigation since not all requirements can be filtered out. Having looked at the options, none could be found that enable stackable boxes. NyroModal comes close, but doesn’t pull the requirement on stackability and its pretty hefty on the file-size (33kB).

So unless somebody points me an alternative, I’ve decided to develop one on my own, which I will of course share when finished. Any tips?


3 Comments on “Finding the Perfect Lightbox”

  1. 1 Jack said at 10:45 pm on May 29th, 2009:

    You should consider ColorBox: http://colorpowered.com/colorbox/

    I fits all of that criteria and is 9kbs of jQuery.

  2. 2 Jack said at 10:48 pm on May 29th, 2009:

    Well, I take that back – I’m not sure about stacking it. You can update the contents of ColorBox while it is open – but you can’t actually open a 2nd one inside of the first without using iframes.

  3. 3 gabssnake said at 6:28 pm on September 21st, 2009:

    Jack, you mean ColorBox can load partial HTML?

    Say, load only a part (div#name) of a given html, like nyroModal?

    Display div#somediv content

    If that it so, I will switch right now.


Leave a Reply