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.

Advertisements
Explore posts in the same categories: Uncategorized

One Comment on “Simple Enhancement To Lightbox”


  1. […] 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 […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: