It's because of the direction of bubbling. You can't capture the event
on the way "down" the parents to the children. You can only capture it
on the way "back up", from children to parents. So your event will hit
the child (link) before the parent (list).

Technically you could capture it on the the way "down", but I seem to
recall it's a bit buggy with some browsers.

Karl Rudd

On 9/6/07, Joel Birch <[EMAIL PROTECTED]> wrote:
>
> I have links in an unordered list and want to do
> $('ul').one('click',fn); without having the links inside the ul
> respond to that first click. Can it be done? How?
>
> I tried doing e.preventCapture inside fn. No worky. Either does return
> false, and I think I tried all of the other similar methods such as
> stopPropagation, preventDefault, etc.
>
> No matter what I do, the anchor element within the list always
> receives the get's focussed. I'd really appreciate some advice on how
> to get around this. I tried the IRC channel but when I mentioned that
> I think the click captures down through the DOM before bubbling back
> up, people's heads exploded. ;)
>
> Thanks
> Joel Birch.
>

Reply via email to