gevans Posted May 27, 2009 Share Posted May 27, 2009 Hey guys, Title pretty much says it all, I have a couple of snippets accessing the same function (i.e. the function works fine). But when I try to execute the function on a keypress I don't get anything. $(document).keypress(function(e) { if(e.which === 27) { closePopup(); } }); I can't see what I'm missing. If anyone has any ideas I'd love to know, Cheers Quote Link to comment https://forums.phpfreaks.com/topic/159891-solved-jquery-keypress-not-working-for-document-selector/ Share on other sites More sharing options...
gevans Posted May 27, 2009 Author Share Posted May 27, 2009 All sorted, change e.which to e.keyCode Strange how it didn't work there but it does in a different layout. Quote Link to comment https://forums.phpfreaks.com/topic/159891-solved-jquery-keypress-not-working-for-document-selector/#findComment-843311 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.