Esc key not detected in Chrome or Safari
Not sure how to fix the problem of the Esc key not detected in Chrome or Safari; is detected in Firefox and IE.
- $(document).ready(function(){
-
- //LOADING POPUP
- //Click the button event!
- $("#button").click(function(){
- //centering with css
- centerPopup();
- //load popup
- loadPopup();
- });
-
- //CLOSING POPUP
- //Click the x event!
- $("#popupContactClose").click(function(){
- disablePopup();
- });
- //Click out event!
- $("#backgroundPopup").click(function(){
- disablePopup();
- });
- //Press Escape event!
- $(document).keypress(function(e){
- if(e.keyCode==27 && popupStatus==1){
- disablePopup();
- }
- });
- });
Any suggestions greatly appreciated...
Todd