[jQuery] Re: jqModal and the ESC key?

2007-10-26 Thread will
You may as well use jQuery for that. :-) $(document).keydown( function( e ) { if( e.which == 27) { // escape, close box $(.jqmWindow).jqmHide(); } }); -Mike nice. ;) jQuery ftw.

[jQuery] Re: jqModal and the ESC key?

2007-10-25 Thread Tobias Parent
Don't see why not - all you have to do is, when the jqModal is displayed, bind the keypress and detect they keyCode for the esc key. Here's the code I'm using: document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; }

[jQuery] Re: jqModal and the ESC key?

2007-10-25 Thread will
Toby, thanks! I thought perhaps it was built into jqModal but I suppose theres nothing like rolling your own. I couldn't get it to work on your site though. :| I'll give it a whirl locally. Thanks, Will On Oct 25, 1:36 pm, Tobias Parent [EMAIL PROTECTED] wrote: Don't see why not - all you

[jQuery] Re: jqModal and the ESC key?

2007-10-25 Thread will
document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // escape, close box $(.jqmWindow).jqmHide(); } };

[jQuery] Re: jqModal and the ESC key?

2007-10-25 Thread Michael Geary
document.onkeydown = function(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if(keycode == 27){ // escape, close box $(.jqmWindow).jqmHide(); } }; You may as well use jQuery for that. :-) $(document).keydown(