Why can't you just use the 2nd example? Semantically that's a lot
better, as you want to really observe each link, not the whole body. I
mean, the first example is saying, "Observe a focus to the body".
That's not really helping at all with the focus of any specific link,
if you see what I mean.
On Sep 18, 11:51 am, Rauan Maemirov <[EMAIL PROTECTED]> wrote:
> It's very simple to do for some html object as ancestor, but not for
> whole body.
>
> What I'm doing wrong?
>
> $(document.body).observe('focus', function(e) {
> if (!(elem = e.findElement('a')))
> return;
> elem.blur();
>
> });
>
> The main aim is to avoid effect of "wrapping the link", when clicking
> on it.
>
> This code works fine:
>
> $$('a').invoke('observe', 'focus', linkBlur);
> function linkBlur(e) {
> elem = e.element();
> elem.blur();
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---