modal close button
<p>I have a div which is in a class="modal", and I written a function in jQuery that closes this div when i press "esc" :</p>

<pre><code>$(document).keypress(function (e) {
    if (e.keyCode == 27) {
        if ($('.modal:visible &gt; .icon32').length) $('.modal:visible &gt; .icon32')[0].click();
    }
}); 
</code></pre>

<p>everything works perfect in firefox, but in chrome does not, what could cause this problem?</p>
