Simple Enhancement To Lightbox

I posted recently about how to use Lightbox to make your web site prettier and more useable, and someone pointed out to me that it would be even better if Lightbox would let you dismiss the image by hitting the escape key.  Doing that required working around some compatibility quirks in Firefox versus IE, so to save anyone else the trouble of doing it you can just grab it from my site.

 For those interested in idiosyncracies of Javascript compatibility, here is what posed the issues:

a)  IE will let you test a keyCode against an integer, including a non-printing ASCII code such as 27 (the escape key).  Firefox requires you to test against a constant, something like event.DOM_VK_ESCAPE .

b)  IE captures non-printing keyboard keys (other than F1-F12, apparently) in the keypressed event, but Firefox only captures them in the keydown event.

No Responses to “Simple Enhancement To Lightbox”

  1. Lakiesha November 27, 2011 at 12:53 am #

    Good points all around. Truly aprepctiaed.

  2. fccxuqyk November 28, 2011 at 3:06 am #

    HNl5zm moslvfzjkvaa

  3. mrhfrmado December 2, 2011 at 5:13 am #

    dtrQat spingjsrwonp

Trackbacks/Pingbacks

  1. Leveraging OSS As A Software Developer « MicroISV on a Shoestring - June 26, 2008

    […] OSS As A Software Developer Cards on the table: I sell proprietary software, do occasional OSS work on both a volunteer and paid basis. and have been known to post to Slashdot on occasion about […]