Lightbox Gone Really Wild

Click here to download:
lightbox.js (6 KB)

This is a revised version of existing javascript. The original post with detailed installation instructions is here:
Lightbox Gone Wild

I'm a big fan of the guys over at Particletree. About 3 years ago they released a javascript lightbox package that allows you to create a modal window above existing content on your page. This isn't the only lightbox script by any means, but it's been useful for me. 

However, there have been changes to the library that it depends on in those 3 years, and if you want to use it now with Prototype 1.6 you'll need to fix it up.
  • Inserts with javascript now use Prototype's Insert method. Fixes a bug in IE6 with document.createElement
  • Removed call to unloadCache. This method has been deprecated and happens automatically. It now causes an error with Prototype 1.6.
  • CSS selectors used to loop through lightbox links. Fixes an issue where some links are missed with getElementsByClassName.
  • Lightbox can now be closed by pressing escape or clicking outside of the lightbox.
Enjoy!

Posted