How do I hide an element when the escape key is pressed?
<p>I found the following script for creating an overlay that opens in it another page:</p>

<pre><code>&lt;script&gt;
    $("a#selector").live("click", function(){
        $(".overlayInner").load("logwork_form.php",
        // the following is the callback   
        function(){$(".overlayOuter").fadeIn(300); });
    });
&lt;/script&gt;
</code></pre>

<p>I'd like to ask you to help me with adding some extra functionality to the script: closing the overlay on pressing the esc key.</p>

<p>I've tried adding the below code but it doesn't work.</p>

<pre><code>//close if esc key is pres
$(document).keyup(function(e) {
    if (e.keyCode == 27) {
        $(".overlayInner").close("logwork_form.php?proiect_id=13", function({
            $(".overlayOuter").fadeOut(300); 
});
</code></pre>
