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.
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;
}
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
document.onkeydown = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
keycode = e.which;
}
if(keycode == 27){ // escape, close box
$(.jqmWindow).jqmHide();
}
};
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(
5 matches
Mail list logo