Good point. I'm having a hard time coming up with a really layout-
agnostic method for fixing this case. There's an example I saw
elsewhere on this list that uses Event.findElement to do this:
document.observe('click', function(event) {
if (event.findElement('#nav')) $('nav
I did :), just small code modification:
[...]
if(evt.element()!=elm && !evt.element().descendantOf(elm))
elm.removeClassName('visible');
[...]
thanks again!
On 13 Paź, 21:57, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
> Good point. I'm having a hard time coming up with a really
*Thanks for advices :)
On 13 Paź, 21:42, poncjusz <[EMAIL PROTECTED]> wrote:
> Thanks for advances.
>
> Walter your I think that your solution is the best but what if my
> toggled element contains another elements ie.
>
> [...]
>
> then when I clicked on img result of:
> var elm = $
Thanks for advances.
Walter your I think that your solution is the best but what if my
toggled element contains another elements ie.
[...]
then when I clicked on img result of:
var elm = $('test');
if(evt.element() == elm)
will be false
On 13 Paź, 15:44, Walter Lee Davis <
Observe document.click, and filter out events that do not include the
item in question.
document.observe('click', function(evt){
var elm = $('yourElement');
if(evt.element() != elm)
elm.hide();
}
Walter
On Oct 12, 2008, at 6:02 PM, poncjusz wrote:
>
>
Hi there,
What I'd do is insert a div element to the document just below the shown
element, and attach a click event to it, which would hide the element and
remove itself from the DOM (or hide too).
Cheers,
Gabriel Gilini
www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]
On Sun, Oct 12, 20