[jQuery] Re: Thickbox 3 + esc to close window

2007-07-25 Thread Gilles (Webunity)
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 ;)

[jQuery] Re: Thickbox 3 + esc to close window

2007-07-25 Thread amircx
yeah but i want to bind this event only when the window is open, so if user press esc in the side it will not disable this key when no need to got me? Gilles (Webunity) wrote: > > > jQuery(document).keypress(function(ev) { > if (ev.which == 27) { .. action .. }; > }); > > Which = jQuery a

[jQuery] Re: Thickbox 3 + esc to close window

2007-07-25 Thread Gilles (Webunity)
jQuery(document).keypress(function(ev) { if (ev.which == 27) { .. action .. }; }); Which = jQuery assigned crossbrowser keycode.