Permalink
Browse files

Added closing the zoom by the esc key.

  • Loading branch information...
1 parent d0df271 commit 0a1361ab4a190bf9e34ea06adee625cc7ae55a05 @orderedlist orderedlist committed Sep 4, 2008
Showing with 4 additions and 1 deletion.
  1. +4 −1 jquery/js/fancyzoom.js
View
@@ -37,7 +37,10 @@ jQuery.fn.fancyZoom = function(options){
$('body').append(html);
$('html').click(function(e){if($(e.target).parents('#zoom:visible').length == 0) hide();});
-
+ $(document).keyup(function(event){
+ if (event.keyCode == 27 && $('#zoom:visible').length > 0) hide();
+ });
+
$('#zoom_close').click(hide);
}

0 comments on commit 0a1361a

Please sign in to comment.