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 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;
>   }
>   if(keycode == 27){ // escape, close box
>     tb_remove();
>   } else if(keycode==13) { // return, submit form
>     signMeUp();
>   }
> document.onkeydown = function(e){
>   if (e == null) { // ie
>     keycode = event.keyCode;
>   } else { // mozilla
>     keycode = e.which;
>   }
>   if(keycode == 27){ // escape, close box
>     tb_remove();
>   } else if(keycode==13) { // return, submit form
>     signMeUp();
>   }
>
> The full version, working mostly, is running athttp://www.questmin.org/
> - simply click on the 'email list' link on the bottom of the page.
>
> Hope this helps!
> -Toby
>
> };};
> will wrote:
> > Is there a way to get jqModal dialogs to hide when you hit the escape
> > key?
>
> > Thanks,
> > Will

Reply via email to