summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/lightbox_lite.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/lightbox_lite.js b/js/lightbox_lite.js
index 12ee281..1e4e63d 100644
--- a/js/lightbox_lite.js
+++ b/js/lightbox_lite.js
@@ -150,8 +150,8 @@ function hideLightbox() {
}
}
- // disable keypress listener
- document.onkeypress = '';
+ // disable keydown listener
+ document.onkeydown = '';
}
@@ -163,7 +163,7 @@ function getKey(e) {
escapeKey = 27;
}
else { // mozilla
- keycode = e.which;
+ keycode = e.keyCode;
escapeKey = e.DOM_VK_ESCAPE;
}
key = String.fromCharCode(keycode).toLowerCase();
@@ -173,7 +173,7 @@ function getKey(e) {
// listenKey()
-function listenKey () { document.onkeypress = getKey; }
+function listenKey () { document.onkeydown = getKey; }
function imgLoadingError(image, objImage, objLink) {
@@ -271,7 +271,7 @@ function showLightbox(objLink) {
arrayPageSize = getPageSize();
objOverlay.style.height = (arrayPageSize[1] + 'px');
- // Check for 'x' keypress
+ // Check for 'x' keydown
listenKey();
return false;