Making Lightbox work in IE9
I’m a big fan of Lokesh Dhakar’s Lightbox script, which is an elegant and easy to use method of displaying images against a darkened background on a web page. I’ve used this script quite heavily in the past, so I was somewhat alarmed when reviewing some of my old projects, to observe that it was broken in Internet Explorer 9.
A quick perusal of the changelog on the Lightbox site soon brought the problem to light. Version 2.05 of the script had been published with the message “Upgraded Prototype (now works in IE9) and Scriptaculous”. I had a look at my code and sure enough, I was using version 2.04.
So, it seemed that it was version 2.05 which I needed, yet this was nowhere to be found on the website. I did see however, that the Lightbox code now lived on GitHub at the following url: https://github.com/lokesh/lightbox2.
Finding myself in Windows, I then fired up GIT bash (see note at end of post) and typed:
git clone https://github.com/lokesh/lightbox2/ cd lightbox2/ git checkout v2.05
Edit: It also occurred to me that GitHub lets you download a complete repository as a zip file. Here’s the link for the Lightbox project: https://github.com/lokesh/lightbox2/zipball/master.
You can download this file, unzip it and look in the ‘releases’ folder for a file named ‘lightbox2.05.zip’. This will also contain the files that you need.
Note: GIT Bash comes bundled with Msysgit. This is one the best packages for compiling GIT for windows and can be found here: http://msysgit.github.com/. After installation it should be available under Start > Programs > Git > Git Bash.
Alternatively, for those who prefer GUIs, check out this tutorial: http://net.tutsplus.com/tutorials/tools-and-tips/git-on-windows-for-newbs/