[jQuery] Re: Capture click on parent and prevent capture to child anchors

2007-09-07 Thread Joel Birch
Thanks for your input, everyone. Much appreciated. :) Joel.

[jQuery] Re: Capture click on parent and prevent capture to child anchors

2007-09-06 Thread Suni
On 6 syys, 15:50, Karl Swedberg <[EMAIL PROTECTED]> wrote: > You should be able to do that using event.target. Try this: > > $('ul').one('click', function(event) { >if ( !$(event.target).is('a') ) { > // your code here >} > }); This is normal bubbling and should be used more :) But

[jQuery] Re: Capture click on parent and prevent capture to child anchors

2007-09-06 Thread Karl Swedberg
Hey Joel, You should be able to do that using event.target. Try this: $('ul').one('click', function(event) { if ( !$(event.target).is('a') ) { // your code here } }); Untested, but should work. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On S

[jQuery] Re: Capture click on parent and prevent capture to child anchors

2007-09-06 Thread Karl Rudd
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 t