try to add event listener to LI element,
and prevent browser default event to A element?

2010/6/29 stratboy <[email protected]>

> Hi! I always have a tedious issue when adding events to menus.
> Obviously, I always have links inside <li> elements. A often need to
> attach events to the <li> elements insted of <a>. The problem is that
> this way, e.target is always == to the <a> elem., not to <li>, because
> of capture phase, I guess, so I always have to do something like this:
>
> var t = ($(e.target).match('li')) ? $(e.target) : $
> (e.target).getParent('li');
>
> Nothing very bad, but, I was wondering.. Is there a way to stop
> capture instead of bubbling, so I get directly the <li> event?
>
> Thanks

Reply via email to