Return to Snippet

Revision: 50091
at September 12, 2011 23:58 by mortu


Updated Code
// lightbox fadeout on escape        
        $(document).bind('keydown', function(e) {//use keydown instead of keypress because keypress doesn't work in Chrome and Opera
        if(e.keyCode==27){
                $("#lightbox").fadeOut(300);
        }
        });

Revision: 50090
at August 9, 2011 23:50 by mortu


Initial Code
// lightbox fadeout on escape        
        $(document).bind('keypress', function(e) {
        if(e.keyCode==27){
                $("#lightbox").fadeOut(300);
        }
        });

Initial URL


Initial Description
Lightbox escape key

Initial Title
Lightbox escape key

Initial Tags


Initial Language
jQuery