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 at http://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