Looks like that's fixed it. I found and applied this:
function doSomething (e) {
var event = e || window.event;
[body of event handler function goes here]
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}
Well very many thanks. I would never have found the solution as I was
looking in the completely wrong direction. I'll dig a bit deeper now so
maybe I will even understand why this happens.
Regards, Walter
-----Original Message-----
From: staffslug-bounces(a)staffslug.org.uk
[mailto:staffslug-bounces@staffslug.org.uk] On Behalf Of David Boucher
Sent: 18 February 2010 18:51
To: staffslug(a)staffslug.org.uk
Subject: Re: [Staffslug] Javascript Problem
walt wrote:
[snipped]
I thought it might be the 'onclick' calls in the sibling elements but when
I
take them out it still happens.
[snipped]
What's happening here is event propagation: the event "bubbles up"
through the elements, so findChildren is called for b1, then called for
a1, causing the effect you are seeing. You can prove this by having
findChildren produce an alert with the id of the element it is being
called for.
I don't have time to do it right now, but I'll see if I can sort out a
fix later (I'm no Javascript expert though). In the meantime, you might
want to try looking into "Javascript event propagation".
Hope this helps,
Dave.
_______________________________________________
Staffslug mailing list
Staffslug(a)staffslug.org.uk
http://lists.staffslug.org.uk/mailman/listinfo/staffslug