On Aug 16, 2007, at 4:01 AM, Wizzud wrote:
Your 'jQuery_How_Do_I_not.html' IS working.
If you were to change one of the #eeeeee colours to some completely
different colour you would be able to see the effect of clicking on
div1.
However, when you click on div2 both click handlers are invoked -
firstly
for div2, then for div1 - because div2 is within div1, and the
event is
being propagated (or bubbled, whichever one it is, I'm never sure!)
which is
not being prevented/cancelled by the div2 click handler.
So it appears that the 'not' is not working, when it actually is!
In which case, you should get along fine if you change the first
click handler to this:
$('#apDiv2').click(function(event) {
$(this).css('background-color','#666666');
event.stopPropagation();
});
If that doesn't work for you, let me know and I'll put a demo page up
somewhere for you.
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com