gjeez ;) function tbClose(ev) { if (ev.which == 27) { .. action .. }; }
Just before you open TB: jQuery(document).keypress(tbClose); Just after you close TB: jQuery(document).unkeypress(tbClose); You could have figured that out ;)
gjeez ;) function tbClose(ev) { if (ev.which == 27) { .. action .. }; }
Just before you open TB: jQuery(document).keypress(tbClose); Just after you close TB: jQuery(document).unkeypress(tbClose); You could have figured that out ;)