onClick: Anywhere But Component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

onClick: Anywhere But Component

dirk newbold
Hi,

I wanted a bespoke styled html select component and found css styling
wasn't supported in IE (correct me if I'm wrong) so I created my own
using scriptaculous.

This all went fine, except for one final characteristic:
 - with the standard select if you click the arrow the dropdown box
appears but if you then decide not to select anything and instead just
click some dead part of the page the dropdown box disappears.

How can I achieve this characteristic?

Cheers,

Dirk
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: onClick: Anywhere But Component

Lukas Renggli
> This all went fine, except for one final characteristic:
>  - with the standard select if you click the arrow the dropdown box
> appears but if you then decide not to select anything and instead just
> click some dead part of the page the dropdown box disappears.
>
> How can I achieve this characteristic?

You register an onClick even on the root of the document. If the
dropdown box is open and if the event has not been handled you close
it.

   http://www.quirksmode.org/js/events_order.html

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: onClick: Anywhere But Component

dirk newbold
Thanks Lukas

On Fri, Oct 2, 2009 at 4:40 PM, Lukas Renggli <[hidden email]> wrote:

>> This all went fine, except for one final characteristic:
>>  - with the standard select if you click the arrow the dropdown box
>> appears but if you then decide not to select anything and instead just
>> click some dead part of the page the dropdown box disappears.
>>
>> How can I achieve this characteristic?
>
> You register an onClick even on the root of the document. If the
> dropdown box is open and if the event has not been handled you close
> it.
>
>   http://www.quirksmode.org/js/events_order.html
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside