Re: [jQuery] IE and the escape key triggering a hide action

2006-11-06 Thread Klaus Hartl
Jörn Zaefferer schrieb:
>> I just came across something in IE, that I hadn't noticed so far: It 
>> seems that the escape key triggers some action by default:
>>
>> Say you have a link which on click opens a form via slide down. If you 
>> then press the escape key, the form slides up again... Is it just me or 
>> did someone else notice that as well? Just wondering if it's Plazes 
>> specific due to my style of coding.
>>
>> For example have a look at the http://plazes.com homepage (sorry, this 
>> is no advertise): There's a login link in the upper right corner, that 
>> triggers a login form to be revealed. If the form is visible in IE press 
>> escape and you will see, that it gets hidden again...
>>
>> I really don't know what's happening?
> 
> Do you use Thickbox for that form? If so, take a look at it's 
> document.onkeyup binding. If not: Ugh, no idea.
> 
> I took a look, but couldn't find it for myself...

If you want to disable that behavior (I had to because pressing escape 
in a thickbox screen triggered the hide on reset...):

if ($.browser.msie) {
 $(document).keydown(function() {
 window.stopEsc = true;
 }).keyup(function() {
 window.stopEsc = false;
 });
}

and then:

$('form').reset(function() {
 if (window.stopEsc)  return false; // in IE the escape key triggers 
the reset action of a form, don't wan't that here
}

Fortunately the reset event is fired between keydown and keyup, tested 
in IE 6/7...


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] IE and the escape key triggering a hide action

2006-11-06 Thread Webunity | Gilles van den Hoven

> Ah, I got it. If you have an input/button of type "reset", the escape 
> key triggers that action in IE...
>   
Jep, funny huh?


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] IE and the escape key triggering a hide action

2006-11-06 Thread Jörn Zaefferer
> I just came across something in IE, that I hadn't noticed so far: It 
> seems that the escape key triggers some action by default:
> 
> Say you have a link which on click opens a form via slide down. If you 
> then press the escape key, the form slides up again... Is it just me or 
> did someone else notice that as well? Just wondering if it's Plazes 
> specific due to my style of coding.
> 
> For example have a look at the http://plazes.com homepage (sorry, this 
> is no advertise): There's a login link in the upper right corner, that 
> triggers a login form to be revealed. If the form is visible in IE press 
> escape and you will see, that it gets hidden again...
> 
> I really don't know what's happening?

Do you use Thickbox for that form? If so, take a look at it's document.onkeyup 
binding. If not: Ugh, no idea.

I took a look, but couldn't find it for myself...

--
Jörn Zaefferer

http://bassistance.de
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] IE and the escape key triggering a hide action

2006-11-06 Thread Klaus Hartl
Klaus Hartl schrieb:
> I just came across something in IE, that I hadn't noticed so far: It 
> seems that the escape key triggers some action by default:
> 
> Say you have a link which on click opens a form via slide down. If you 
> then press the escape key, the form slides up again... Is it just me or 
> did someone else notice that as well? Just wondering if it's Plazes 
> specific due to my style of coding.
> 
> For example have a look at the http://plazes.com homepage (sorry, this 
> is no advertise): There's a login link in the upper right corner, that 
> triggers a login form to be revealed. If the form is visible in IE press 
> escape and you will see, that it gets hidden again...
> 
> I really don't know what's happening?
> 
> 
> -- Klaus

Ah, I got it. If you have an input/button of type "reset", the escape 
key triggers that action in IE...

Ugh!


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] IE and the escape key triggering a hide action

2006-11-06 Thread Klaus Hartl
I just came across something in IE, that I hadn't noticed so far: It 
seems that the escape key triggers some action by default:

Say you have a link which on click opens a form via slide down. If you 
then press the escape key, the form slides up again... Is it just me or 
did someone else notice that as well? Just wondering if it's Plazes 
specific due to my style of coding.

For example have a look at the http://plazes.com homepage (sorry, this 
is no advertise): There's a login link in the upper right corner, that 
triggers a login form to be revealed. If the form is visible in IE press 
escape and you will see, that it gets hidden again...

I really don't know what's happening?


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/