Thanks. And you are right. I had already used alert to check the IDs 2 or
3 days ago and it does work its way back from say c1 back up to a1 without
any help from me. None of the languages I have used do this or at least I
have never seen it happen.
Anyway, I'll check out event propagation later on. Meantime thanks for your
offer to look into a fix. No rush! I just wanted to understand dom and then
thought I could use all these javascript tricks to generate a nifty menu
system. :-)
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