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 Sep 6, 2007, at 6:22 AM, Joel Birch 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