To do this, stop the click on the child using .stopPropagation:
$(".example").click(function(){
$(this).fadeOut("fast");
}).children().click(function(e) {
return false;
});
This will stop the child clicks from bubbling up past their level so the parent won't receive the click.
.not()
is used a bit differently, it filters elements out of your selector, for example:
<div class="bob" id="myID"></div>
<div class="bob"></div>
$(".bob").not("#myID"); //removes the element with myID
For clicking, your problem is that the click on a child bubbles up to the parent, not that you've inadvertently attached a click handler to the child.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…